Posts Tagged ‘menu_helper’

Zend_Navigation Render the SubMenu for Active Menu Item using a Partial

One of the biggest problems with Zend_Navigation helpers is using partials to render sub-menus in order to achieve customized rendering especially when additional properties have been defined.

The approach to the solution is as follows:

// find the first active menu item
$subnav = $this->navigation()->menu()->findOneByActive(1);
// The finder methods return null for no matches so nee to check that
if ($subnav != null) {
// render the matched menu using a partial
echo $this->navigation()->menu()->renderPartial($subnav, 'index/customsubmenu.phtml');

%d bloggers like this: