MyBB Community Forums

Full Version: Simple Templates Question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I created a new global template for my google site search named 'google_search'. I want to use that template inside my 'header' template. What do I need to use?

I tried {$google_search}, {google_search}, {$templates->google_Search}, etc. and nothing works.
You have to take it a step further and add the following to the desired PHP document or via a plugin:
eval("\$google_search = \"".$templates->get("google_search")."\";");
Strike1011 Wrote:I created a new global template for my google site search named 'google_search'. I want to use that template inside my 'header' template. What do I need to use?

I tried {$google_search}, {google_search}, {$templates->google_Search}, etc. and nothing works.
Someone's been using Wikipedia way too much...Toungue
Couldn't I just use

$google_search = $templates->get("google_search");
No as eval parses the php variables within the template as well, if you have any. This is standard way MyBB does it.
You can use it, but preferred using it within eval.
So if I use the eval, then I can have php in my custom templates or just variables? and if I use the one I posted, It will display it without php?