The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
|||
|
|||
Passing variables into custom templates
I'm creating a custom page (or rather a custom set of pages) that are referenced off the main navbar (thanks to the tutorial in the articles section on here ), but I don't seem to be able to get variables from $templater->register() to actually display within my template
Code extracts: predictionleague.php Code:
$navbits = array('prediction-league' => 'Prediction League'); $variable_to_pass = 'Passing through...'; $navbar = render_navbar_template(construct_navbits($navbits)); $templater = vB_Template::create('sweb_prediction_league'); $templater->register_page_templates(); $templater->register('navbar', $navbar); $templater->register('variable_to_pass', $variable_to_pass); print_output($templater->render()); Code:
... <body style="text-align:left"> {vb:raw header} {vb:raw navbar} {vb:raw toolbar} <div class="sweb_pl_block"> <h1>{vb:raw variable_to_pass}</h1> </div> {vb:raw footer} </body> </html> Output: Code:
<div class="sweb_pl_block"> <h1></h1> </div> |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|