Pages

Monday, May 6, 2013

Social Engine 4-Fetching and displaying a menu from backend

1. Create a menu from admin backend by going to Layout->Menu Editor from menu

2. Now go to database and in table "engine4_core_menus" find the entry for your menu and give the same name under "name" field(if already not there)

3. Now in controller to assign the menu to a view variable use

 $this->view->navigation=Engine_Api::_()->getApi('menus','core')->getNavigation('credit_main');  

where 'credit_main' is the 'name' of your menu from table "engine4_core_menus"

To render menu in view use


 echo $this->navigation()->menu()->setContainer($this->navigation)->render();  



No comments:

Post a Comment