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/Rohan/CreateAdminController/etc
<config>
<modules>
<Rohan_CreateAdminController>
<version>1.0.0</version>
</Rohan_CreateAdminController>
</modules>
<global>
<helpers>
<rohan_createadmincontroller>
<!-- Helper definition needed by Magento -->
<class>Mage_Core_Helper</class>
</rohan_createadmincontroller>
</helpers>
</global>
<adminhtml>
<layout>
<updates>
<Rohan_CreateAdminController>
<file>rohan_createadmincontroller.xml</file>
</Rohan_CreateAdminController>
</updates>
</layout>
</adminhtml>
<admin>
<routers>
<adminhtml>
<args>
<modules>
<foo_bar before="Mage_Adminhtml">Rohan_CreateAdminController_Adminhtml</foo_bar>
</modules>
</args>
</adminhtml>
</routers>
</admin>
This is my adminhtml.xml file
path: app/code/community/Rohan/CreateAdminController/etc
<?xml version="1.0" encoding="UTF-8"?>
<config>
<menu>
<mycustomtab module="rohan_createadmincontroller" translate="title">
<title>My Custom Tab</title>
<sort_order>100</sort_order>
<children>
<index module="rohan_createadmincontroller" translate="title">
<title>Index Action</title>
<sort_order>1</sort_order>
<action>adminhtml/custom</action>
</index>
<list module="rohan_createadmincontroller" translate="title">
<title>List Action</title>
<sort_order>2</sort_order>
<action>adminhtml/custom/list</action>
</list>
<third module="rohan_createadmincontroller" translate="title">
<title>Third Action</title>
<sort_order>3</sort_order>
<action>adminhtml/custom/third</action>
</third>
</children>
</mycustomtab>
</menu>
<acl>
<resources>
<admin>
<children>
<custom translate="title" module="rohan_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>
` This is my CustomController.php file
Path: app/code/community/Rohan/CreateAdminController/controllers/Adminhtml
<?php
class Rohan_CreateAdminController_Adminhtml_CustomController extends Mage_Adminhtml_Controller_Action
{
public function indexAction()
{
$this->loadLayout()
->_setActiveMenu('mycustomtab')
->_title($this->__('Index Action'));
// my stuf
echo "index";
$this->renderLayout();
}
public function listAction()
{
$this->loadLayout()
->_setActiveMenu('mycustomtab')
->_title($this->__('List Action'));
// my stuff
echo "list";
$this->renderLayout();
}
public function thirdAction()
{
$this->loadLayout()
->_setActiveMenu('mycustomtab')
->_title($this->__('Third Action'));
// my stuff
echo "third";
$this->renderLayout();
}
}
I want to display something in the main area. I know i need to create layout and template files for this but I can't understand how to do that.