PDA

View Full Version : template with in a template


BBR-APBT
07 Dec 2009, 18:17
This is for my switch this makes a error.

case "add":
$templater = vB_Template::create('Site_Glossary');
$templateradd = vB_Template::create('Site_Glossary_add');
break;
default: $templater = vB_Template::create('Site_Glossary');
}

// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######


$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
$templater->register('glossarynav', $glossarynav);
$templater->register('templateradd', $templateradd);
$templater->register('show', $show);
print_output($templater->render());
?>

I remember you could do

$templateradd = fetch_template('Site_Glossary_add');


Now this outputs

$final_rendered = 'blah ';


I am calling it with in the template using

{vb:raw templateradd}

On the new page it should show the new template with in the first template.

P.S. I am trying to have all one php page

Lynne
07 Dec 2009, 18:41
How can you register the variable $templateradd when you never actually rendered the template? All you've done is create it, you never rendered it.

BBR-APBT
07 Dec 2009, 18:53
ahhh I see

case "add":
$templater = vB_Template::create('Site_Glossary');
$templateradd = vB_Template::create('Site_Glossary_add');
$templateradd = $templateradd->render();
break;
default: $templater = vB_Template::create('Site_Glossary');
}


Thanks again Lynne, I don't know what I would do with out you sometimes.

Lynne
07 Dec 2009, 19:13
Thanks again Lynne, I don't know what I would do with out you sometimes.
Sometimes, you just need a second set of eyes.... or in my case, four eyes. :D