MyBB Community Forums

Full Version: Calling Templates [another question!]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've got a few questions, and I was wondering if anyone would know how to do these things.

1) I want to be able to "Call" a template from another template. I'm placing a pretty detailed image map into a portion of my header, and instead of having it junk up my header, I'd like to do this: Have a template titled "mapping" or something, and place all the map details in there. Then, in the header where I'd like to call in that map, I'd put the phrase (kind of like $sub_forums does for building categories) into the header template, and it would compile and show up like normal.

--

2) I want to add in another field when building forums. For instance, when you're in the forum and posts section of your admin panel and you make a new forum, it asks for a name, description, moderator, etc... I want it to also have a field for an individual image that would also be able to be called in the forumbit templates.

Is there a way to do either of these? I appreciate any pushes in the right direction with these, thank you.
1. adding a custom template to a regular template is possible by using one of below plugins
php in templates | Global Templates | Load Templates

2. in general, images for the forum are added by manual edits to the templates (eg. custom forum icons)
you may not be referring to forum icons, but the idea is to use a similar method. variable like {$forum['fid']}.png
can be used in forum related templates and images can be 1.png, 2.png .. etc.
HMM, I don't suppose there is anything I could do in the server to alter it on a more base level? Basically, set it up so it treats this extra field the same way it handles anything else in that edit section?
^ how exactly you want to use that image ? do you have to edit it more often
I may have to, as things change around the site. Just seems easier than having a massive code in my header, if I can avoid it. Does that plug in let me change it through the ACP that doesn't require an individual call code for each and every one?
Actually, now I've got another questions. I'm trying to call in {$lastpost} in one of my templates that is not within the forumbit, but a custom template. I'd like to define what {$lastpost} displays based on the fid, which I would define. Something like {$lastpost['fid']} except instead of just fid, it would be a number to determine the forum in question. Is there a way of doing this?