stevegrant
11-23-2009, 03:52 PM
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
$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());Template sweb_prediction_league:
...
<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>The bizarre thing is that the navbar modification (i.e. adding the breadcrumb trail) DOES get passed through and displayed correctly, but variable_to_pass doesn't!
Output:
<div class="sweb_pl_block">
<h1></h1>
</div>
Any ideas?
Code extracts:
predictionleague.php
$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());Template sweb_prediction_league:
...
<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>The bizarre thing is that the navbar modification (i.e. adding the breadcrumb trail) DOES get passed through and displayed correctly, but variable_to_pass doesn't!
Output:
<div class="sweb_pl_block">
<h1></h1>
</div>
Any ideas?