PDA

View Full Version : calling custom templates?


PranK
01-30-2004, 12:57 PM
Hi Guys,

I did search but i couldn't find exactly what i was after.

its kinda silly, but i am still trying to get my head around VBulletin!

I have made a template for my banner system, but i dont understand how I can call that in other templates? for example, in 'header', i put $template where i want it, but nothing comes up.... if i paste the code from the $template into the same spot - it all works!

sorry, i know i'm a lamer, but how do i make a template that i can call to from other templates?

Thanks in advance!

Christian

NTLDR
01-30-2004, 01:15 PM
In whichever PHP file is delaing with the page put:

eval("\$varname = \"".fetch_template('templatename')."\";");

Obviously replacing $varname with what you want in the template and templatename with the name of the template. DOn't forgot to add templatename to the $globaltemplates array at the top of the file.

PranK
01-30-2004, 01:23 PM
thanks NTLDR, i just worked it out. :)

i did it a different way, it was probably wrong, but i created a new php file, put the contents in there, used an include to it from the page i wanted it on, then called for it in the template... after typing it, it seems that your way would be quicker/easier..

Christian