I've created a module which creates a custom tab in the admin panel but I've not been able to display the required data.`
This is my config.xml file
Path: app/code/community/JR/CreateAdminController/etc
<?xml version="1.0"?>
<config>
<modules>
<JR_CreateAdminController>
<version>1.0.0</version>
</JR_CreateAdminController>
</modules>
<global>
<helpers>
<jr_createadmincontroller>
<!-- Helper definition needed by Magento -->
<class>Mage_Core_Helper</class>
</jr_createadmincontroller>
</helpers>
</global>
<admin>
<routers>
<adminhtml>
<args>
<modules>
<foo_bar before="Mage_Adminhtml">JR_CreateAdminController_Adminhtml</foo_bar>
</modules>
</args>
</adminhtml>
</routers>
</admin>
</config>
This is my adminhtml.xml file
path: app/code/community/JR/CreateAdminController/etc
<?xml version="1.0" encoding="UTF-8"?>
<config>
<menu>
<mycustomtab module="jr_createadmincontroller" translate="title">
<title>My Custom Tab</title>
<sort_order>100</sort_order>
<children>
<index module="jr_createadmincontroller" translate="title">
<title>Index Action</title>
<sort_order>1</sort_order>
<action>adminhtml/custom</action>
</index>
<list module="jr_createadmincontroller" translate="title">
<title>List Action</title>
<sort_order>2</sort_order>
<action>adminhtml/custom/list</action>
</list>
</children>
</mycustomtab>
</menu>
<acl>
<resources>
<admin>
<children>
<custom translate="title" module="jr_createadmincontroller">
<title>My Controller</title>
<sort_order>-100</sort_order>
<children>
<index translate="title">
<title>Index Action</title>
<sort_order>1</sort_order>
</index>
<list translate="title">
<title>List Action</title>
<sort_order>2</sort_order>
</list>
</children>
</custom>
</children>
</admin>
</resources>
</acl>
</config>
This is my CustomController.php file
Path: app/code/community/JR/CreateAdminController/controllers/Adminhtml
<?php
class JR_CreateAdminController_Adminhtml_CustomController extends Mage_Adminhtml_Controller_Action
{
public function indexAction()
{
$this->loadLayout()
->_setActiveMenu('mycustomtab')
->_title($this->__('Index Action'));
// my stuff
$this->renderLayout();
}
public function listAction()
{
$this->loadLayout()
->_setActiveMenu('mycustomtab')
->_title($this->__('List Action'));
//var_dump(Mage::getSingleton('core/layout')->getUpdate()->getHandles());
//die();
// my stuff
echo "string";
$this->renderLayout();
}
}
This is my jr_createadmincontroller.xml file
path:app/design/adminhtml/default/default/jr_createadmincontroller.xml
<?xml version="1.0"?>
<layout>
<adminhtml_custom_index>
<reference name="content">
<block type="core/template" name="custom_index" template="custom/index.phtml" />
</reference>
</adminhtml_custom_index>
<adminhtml_custom_list>
<reference name="content">
<block type="core/template" name="custom_list" template="custom/list.phtml" />
</reference>
</adminhtml_custom_list>
</layout>
The Path of Custom folder is app/design/adminhtml/default/default/Template/Custom
There is index.phtml and list.phtml