PDA

View Full Version : template with in a template


BBR-APBT
12-07-2009, 04:17 PM
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
12-07-2009, 04:41 PM
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
12-07-2009, 04:53 PM
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
12-07-2009, 05:13 PM
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