Pages

Showing posts with label admin. Show all posts
Showing posts with label admin. Show all posts

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();  



Sunday, May 5, 2013

Social Engine 4-Managing a page from Admin Panel or only by widgets

In Social Engine 4 many a times we feel the need to manage our page only from backend i.e. from the widgets we have created only

Here are the steps to perform the same

1. Disable layout from controller's action function you have to create an action for the newly added page see second step on how to add actions for concerned pages in respective controllers

$this->helper->content->setNoRender()->setEnabled();

2. In "Engine4_core_pages" find the corresponding entry to your newly created page(generally this will be the last entery of table if ordered by id).

and set its name as

"credit_index_manage" or "credit_index_network"

Here
"credit" is your module name
"index" is the controller(IndexController) of module
and
"manage/network" are the action names under the controller

that's it now you can manage your page from widgets in backend no need to create a view.....