I have created a custom module that adds two menus in catalog. I have also created a controller for one of the menu , but the controller never gets called but instead is redirected to the admin dashboard page.
My question is some what related to this question Magento admin routing isn't working
I have tried the suggestions mentioned in the answers but none of them worked for me.
When ever I call the url http://localhost/compare/index.php/ecomm/index/key/bb9f436ee373421b170aa862a1cbb305/
I get redirected to http://localhost/compare/index.php/admin/dashboard/index/key/bb9f436ee373421b170aa862a1cbb305/ and hello world never gets printed.
I'm using magento 1.9 and have disabled all the caches.
My module name is Super_Awesome and below is the directory structure
Super | |-Awesome |-etc (adminhtml.xml, config.xml) |-controllers (ManageEcomm.php) |-Helper (Data.php)
The config file in app/etc/modules/Super_Awesome.xml is as follows
<?xml version="1.0"?>
<config>
<modules>
<Super_Awesome>
<active>true</active>
<codePool>local</codePool>
</Super_Awesome>
</modules>
</config>
The config file in app/code/local/Super/Awesome/etc/config.xml is
<?xml version="1.0"?>
<config>
<modules>
<Super_Awesome>
<version>0.1.0</version>
</Super_Awesome>
</modules>
<admin>
<routers>
<ecomm>
<use>admin</use>
<args>
<module>Super_Awesome</module>
<frontName>ecomm</frontName>
</args>
</ecomm>
</routers>
</admin>
<adminhtml>
<!-- The <acl> section is for access control. Here we define the pieces where access can be controlled within a role. -->
<acl>
<resources>
<admin>
<children>
<catalog>
<!--<title>Awesome Menu Item</title>-->
<children>
<example translate="title" module="awesome">
<title>Manage Ecommerce</title>
</example>
<example1 translate="title" module="awesome">
<title>Manage Ecommerce Pages</title>
</example1>
</children>
</catalog>
</children>
</admin>
</resources>
</acl>
</adminhtml>
<global>
<helpers>
<awesome>
<class>Super_Awesome_Helper</class>
</awesome>
</helpers>
</global>
</config>
Controller app/code/local/Super/Awesome/controllers/IndexController.php
<?php
class Super_Awesome_IndexController extends Mage_adminhtml_Controller_Action
{
public function indexAction()
{
echo "hello world";
exit();
}
}
Finally the adminhtml.xml file in app/code/local/Super/Awesome/etc/
<?xml version="1.0"?>
<config>
<menu>
<catalog translate="title" module="awesome">
<!--<title>Awesome</title>
<sort_order>15</sort_order>-->
<children>
<example translate="title" module="awesome">
<title>Manage Ecommerce</title>
<sort_order>1</sort_order>
<action>adminhtml/ecomm</action>
</example>
<example1 translate="title" module="awesome">
<title>Manage Ecommerce Pages</title>
<sort_order>2</sort_order>
<action>adminhtml/example/index</action>
</example1>
</children>
</catalog>
</menu>
</config>