Pages

Showing posts with label widgets. Show all posts
Showing posts with label widgets. Show all posts

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.....


Sunday, April 21, 2013

Social Engine 4-Render and manage a page/view from backend

Here I will show you how to create and run a page from backend and get the control of the same from backend in Social Engine 4

Generally when we create pages we need to define a controller and action for them and control them via code.Some themes have fixed pages in them which are controlled directly from backend.

But if we want to add a custom page to be manageable from backend here is how to do the same

  1. First things First Take a backup of your database and also the files that you modify along I prefer to use a versioning system for lator case
  2. Create a new blank page from "Layout Manager"  in the backend/backadmin of Social Engine 4
  3.  Now go to your database and in the table Engine4_core_pages you will find NULL in "name" change this to "yourmodulename_yourcontrollername_yourviewname" for example if your
    1. Module is "Credits"
    2. Controller is "index"
    3. View is also "index"
Then name will be "credit_index_index"

Give it a title and description which you can also set from backend by modifying this page

4. Navigate to your Module directory "credits" in this case and then navigate to controllers and under controller create a file "IndexController"

1:  <?php   
2:  class Credit_IndexController extends Core_Controller_Action_Standard  
3:  {  
4:    public function indexAction()  
5:    {  
6:        $this->_helper->content->setNoRender()->setEnabled();  
7:    }  
8:  }  
9:  ?>  

This lets you add page from backend but will not render its content i.e "/module/views/scripts/index.tpl"

Now your view will be rendered and managed from backadmin only