View Full Version : Invoking custom templates
lightnb
05-28-2006, 09:13 PM
I created a new template called "forums_menu".
Then in the FORUMHOME template, I added $forums_menu, between the $header and $navbar templates:
$header
$forums_menu
$navbar
But it doesn't seem to work. Am I missing a step?
Paul M
05-28-2006, 09:15 PM
Have you added some php somewhere to fetch the template into $forums_menu ?
calorie
05-28-2006, 09:27 PM
Add the following as a plugin using the forumhome_complete hook:
eval('$forums_menu = "' . fetch_template('forums_menu') . '";');
lightnb
05-28-2006, 09:43 PM
Got it working now. Thank you.
So basically the hooks are places in the vB PHP script where you can add custom PHP code?
calorie
05-28-2006, 09:53 PM
Yep, exactly. :)
lightnb
05-28-2006, 10:38 PM
Let's say I have a new template, and I want to call the contents of the template directly from a PHP file.
For example, I have myscript.php, and I want to be able to see the contents of 'my_template' when I go to 'www.mysite.com/myscript.php
How would you go about doing that?
I tried:
eval('print_output("' . fetch_template('my_template') . '");');
but Got:
Fatal error: Call to undefined function: fetch_template() in /home/.sites/22/site13/web/livexchange/vbheader.php on line 68
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.