Skip to content

Displaying Multiple Templates

Derek Jones edited this page Jul 5, 2012 · 11 revisions

Category:Help::Templates | Category:Help::TipsAndTricks

When you try and load more than one View (for whatever reason) in one function, you see that it simply just won't work. There are a number of ways to do this using cascaded templates or nested templates:

Main template

<html xmlns="" lang="en" xml:lang="en">
   <link href="/css/css.css" rel="STYLESHEET" type="TEXT/CSS" />


<div id="logo">
    <img src="logo.gif" alt="logo"/>

<div id="navside"> {navside} </div>

<div id="cont">
    <div id="intro"> {intro} </div>
    <div id="bread"> {bread} </div>
    <div id="navtop"> {navtop} </div>
    <div id="middle"> {middle} </div>
    <div id="foot"> {foot} </div>


Main controller

$maindata['navside'] = $this->parser->parse('navside',$data,true);
$maindata['intro'] = $this->parser->parse('intro',$data,true);
$maindata['bread'] = $this->parser->parse('bread',$data,true);
$maindata['navtop'] = $this->parser->parse('navtop',$data,true);
$maindata['middle'] = $this->parser->parse('cust/view',$data,true);
$maindata['foot'] = $this->parser->parse('foot',$data,true);

Clone this wiki locally
You can’t perform that action at this time.