1

I have tried to create a new module for the magento admin section. I have seen many topics on this problem but none of them solved my issue.

I have created a file in app/etc/modules/ named Company_CustomList.xml

<?xml version="1.0"?>
<config>
         <modules>
                <Company_CustomList>
                        <active>true</active>
                        <codePool>local</codePool>
                </Company_CustomList>
         </modules>
</config>

Then in app/code/local/Company/CustomList I have created the following files:

app/code/local/Company/CustomList/Block/List.php

<?php
class Company_CustomList_Block_List extends Mage_Core_Block_Template
{
  // necessary methods
}
?>

app/code/local/Company/controllers/Adminhtml/IndexController.php

<?php
class Company_CustomList_Adminhtml_IndexController extends Mage_Adminhtml_Controller_Action
{
    public function indexAction()
    {
        $this->loadLayout();
        $this->renderLayout();
    }


}
?>

app/code/local/Company/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Company_CustomList>
            <version>0.1.0</version>
        </Company_CustomList>
    </modules>
    <adminhtml>
        <acl>
            <resources>
                <admin>
                    <children>
                        <customlist>
                            <title>Custom list</title>
                            <children>
                                <example translate="title" module="customlist">
                                    <title>Index</title>
                                </example>
                            </children>
                        </customlist>
                    </children>
                </admin>
            </resources>
        </acl>
    </adminhtml>
    <global>
        <helpers>
            <customlist>
                <class>Company_CustomList_Helper</class>
            </customlist>
        </helpers>
    </global>
</config>

app/code/local/Company/etc/adminhtml.xml

<?xml version="1.0"?>
<config>
    <menu>
        <customlist translate="title" module="customlist">
            <title>Custom list</title>
            <sort_order>15</sort_order>
            <children>
                <example translate="title" module="customlist">
                    <title>Index</title>
                    <sort_order>1</sort_order>
                    <action>adminhtml/customlist/index</action>
                </example>
            </children>
        </customlist>
    </menu>
    <acl>
        <resources>
            <admin>
                <children>
                    <customlist translate="title" module="customlist">
                        <title>Custom list</title>
                        <sort_order>15</sort_order>
                        <children>
                            <example translate="title" module="customlist">
                                <title>Index</title>
                                <sort_order>1</sort_order>
                                <action>adminhtml/customlist/index</action>
                            </example>
                        </children>
                    </customlist>
                </children>
            </admin>
        </resources>
    </acl>
</config>

app/code/local/Company/Helper/Data.php

<?php
class Company_CustomList_Helper_Data extends Mage_Core_Helper_Abstract {

}

?>

The problem might come from my ACL... but I really can't find how to fix it.

Thanks,

3
  • Can you include the question in the question text? Commented May 11, 2013 at 20:49
  • You are missing routers definition for your module. Commented May 12, 2013 at 2:08
  • The location of Company_CustomList_Adminhtml_IndexController should be app/code/local/Company/{CustomList}/controllers/Adminhtml/IndexController.php not app/code/local/Company/controllers/Adminhtml/IndexController.php Commented May 12, 2013 at 18:58

3 Answers 3

1

Maybe the answer is really simple. Try renaming everywhere CustomList to Customlist in all files. If that is not an answer you can try comparing your settings and files with this link

Sign up to request clarification or add additional context in comments.

1 Comment

Hi and thank you for your suggestion but it does not work :(.
1

Here is suggesting you to make new module you can use module creator and you can avoid error like this if you want to utilize your time.

Please use below link for online generation of module creator

or you can also download module creator from various sites just search it out.

And one more thing if same error will generate again please clear your cache with magento as well as your browser caching also

Have nice day.

Let me know if i can help you more.

1 Comment

thanks for the link. Now don't have to waist time. I just focus on the code :)
0

When create a magento admin module you can create it in one of two ways (The above menu url will not work)

<adminhtml>
    <menu>
        <menu1 translate="title" module="customlist">
            <title>ActiveCodeline SampleModule1</title>
            <sort_order>60</sort_order>
            <children>
                <menuitem1 module="SampleModule1">
                    <title>Menu item 1</title>
                    <action>{{adminhtml/customlist}}/index</action>
                </menuitem1>

<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <Company_CustomList before="Mage_Adminhtml">Foo_Bar_Adminhtml</Company_CustomList>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

Or

<adminhtml>
    <menu>
        <menu1 translate="title" module="customlist">
            <title>ActiveCodeline SampleModule1</title>
            <sort_order>60</sort_order>
            <children>
                <menuitem1 module="SampleModule1">
                    <title>Menu item 1</title>
                    <action>{{customlist}}/index</action>
                </menuitem1>


<admin>
    <routers>
        <samplemodule1>
            <use>admin</use>
            <args>
                <module>ActiveCodeline_SampleModule1</module>
                <frontname>customlist</frontname>
            </args>
        </samplemodule1>
    </routers>
</admin>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.