PDA

View Full Version : Adding a new template...


TheMusicMan
11-18-2005, 09:29 AM
As I have a few weeks of free time I am trying to start to learn a little about PHP and the new plug-in/hook system in vB. I am starting by trying to figure out how to simply add a new template to the style (which I can do) and call this template via a plug in hook wherever I want it to appear.

Do I:

1 - write and create new template
2 - identify the hook insert point
3 - use the following PHP in the hook..

eval('print_output("' . fetch_template('mynewtemplate') . '");');

?? is that what I need to do...?

Apologies re the total newbieness here folks. Ta for assistance...

peterska2
11-18-2005, 01:03 PM
in hook cache_templates

ADD

$globaltemplates = array_merge($globaltemplates, array('TEMPLATE NAME - NO $'));

In hook parse_tamplates

ADD

eval('$navbar_bottom = "' . fetch_template('TEMPLATE NAME - NO $') . '";');

Using the parse templates hook makes it a global thing so you can stick $templatename anywhere in any template

Create your template then put $templatename in the places where you want it to show.

TheMusicMan
11-18-2005, 01:23 PM
Thanks Kerry...

I assume you meant also I do not include a $ in the template name ??

peterska2
11-18-2005, 01:34 PM
Exactly.

Happy to help as always John :)