PDA

View Full Version : Calling templates.


Muazam
06-29-2010, 02:55 PM
Hey, I'm trying to separate header image and log in area.

I see {vb:raw header} in "FORUMHOME".
I created a new template with the name "header2" and added it in FORUMHOME above {vb:raw header}. But it did not show up or anything.

I added header2 template like this:
{vb:raw header2}

How do I actually add it?
Anyone?

Thanks.

Muazam
06-30-2010, 03:50 PM
bump

Xencored
06-30-2010, 03:56 PM
hmm you just add the code in the header template
there is no need for second header :erm:

Muazam
06-30-2010, 04:11 PM
I already fixed that =P, I just want to know how to use the header2 template in another template. putting {vb:raw header2} in another template did not work.

Do you know how to?

Xencored
06-30-2010, 04:31 PM
I already fixed that =P, I just want to know how to use the header2 template in another template. putting {vb:raw header2} in another template did not work.

Do you know how to?

yes you will have to Register that Variable

http://www.vbulletin.com/docs/html/templates_externalfiles

noppid
06-30-2010, 04:32 PM
Try something like this on hook forumhome_complete.


$templater = vB_Template::create('header2');
$header2 = $templater->render();

vB_Template::preRegister('FORUMHOME', array('header2' => $header2) );


You need to cache the template too on hook cache_templates.

if(THIS_SCRIPT=='index')
{
$cache[] = 'header2';
}



That should get you started.

Muazam
06-30-2010, 06:20 PM
Thanks guys, I really appreciate the help ;)