PDA

View Full Version : Template parsing help


SonicGT
01-05-2010, 07:01 PM
I am a beginner and haven't done any mods yet. I have a simple mod I'm attempting to create and cant figure out how to get my template to show up in a page, im sure im just making a simple mistake.

My template name is 'Signature_Rules'

I have this in the plugin and hooked to parse_templates

$templater = vB_Template::create('Signature_Rules');
$templater->register('signaturerules',$signaturerules);
$signaturerules = $templater->render();

and am trying to call it using
{vb:raw signaturerules}

I'm not sure if im using improper syntax or calling the wrong things any beginner help is appreciated

Lynne
01-05-2010, 08:43 PM
You need to then (pre)register the variable $signaturerules for use in whatever template you are now going to go use it in.
vB_Template::preRegister('whatever_template', array('signaturerules' => $signaturerules));

SonicGT
01-05-2010, 08:55 PM
You need to then (pre)register the variable $signaturerules for use in whatever template you are now going to go use it in.
vB_Template::preRegister('whatever_template', array('signaturerules' => $signaturerules));

Awsome this worked thanks, now just have to work on getting my template to look how I want it :)