Zend_Navigation update

Continuing from the breadcrumbs post, it is possible to render more than one zend navigate menu. The bootstrap code looks for different sections of the xml, which we tweak like this:

<configdata>
  <nav>
    <headnav>
     <home>.....</home>
    </headnav>
    <footnav>
       <etc></etc>
    </footnav>
  </nav>
<configdata>

and the bootstrap we can say:

$config = new Zend_Config_Xml(APPLICATION_PATH.'/configs/navigation.xml','nav');
 $view->headnav = new Zend_Navigation($config->headnav);
 $view->footnav = new Zend_Navigation($config->footnav);
 Zend_Registry::set('HeadNavigation', $view->headnav);
 Zend_Registry::set('FootNavigation', $view->footnav);

we can now use both menus in our layout like this:

echo $this->navigation()->menu()->renderMenu($this->headnav);
 echo $this->navigation()->menu()->renderMenu($this->footnav);

However I am yet to discover what to do to get the breadcrumbs working like this!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s