MyBB Community Forums

Full Version: Can custom templates be used on themes?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi all,

I've tried before, and just tried now, but for some sort of reason when I try to create custom templates inside a theme, they won't work when I call them.

Can somebody tell me the needed steps to make this work? (Maybe there's a plugin required or something).

Thanks Smile
Template is called about:
<?php
define("IN_MYBB", 1);
$templatelist = "about";
require_once 'global.php';

     eval("\$page_about = \"".$templates->get("about")."\";");
     output_page($page_about);
?>
That should do it Wink.
Thanks Bob, but I'm sorry for not being specific. I was talking about creating a custom template, and use it inside another template?

I'm not sure why it doesn't work.
Ohh I never got that to work either, what code do you try to call it.
I just tried {$custom_template} Toungue
Nope, can't do it without a plugin. Even with the plugin it's still a bit quirky and doesn't work too well. Search for global templates or use the PHP conditionals plugins to call them.
Oh thanks Scoutie. I guess I'll just leave the whole code inside the other templates.
If it don't work by default why have a feature that allows it. That is a bit wierd..

Sorry for hijacking I am just curoius..
That's pretty much what I was thinking, so I tried to see if it was actually my procedure which failed. But I guess custom templates are meant for something other than using them within templates.
I think custom templates were meant for theme designers to customize templates added by plugins, which don't get copied when you add a new template set. My plugin kind of allows custom templates, but without a hook I need it only works if the custom template is in the "Global Templates" set (which defeats the purpose of creating new template sets).
Pages: 1 2