Take the 2-minute tour ×
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It's 100% free, no registration required.

I've created a module which I named it in CamelCase like MyCustomModule. I've just started it as a little application and wanted to add a menu in admin for that the adminhtml.xml code is

<menu>
    <sales>
        <children>
            <my_custom_module>
                <title>My Custom Module</title>
                <sort_order>0</sort_order>
                <action>my_custom_module/adminhtml_order</action>
            </my_custom_module>
        </children>
    </sales>
</menu>

This is working fine. But as I see in other xmls they have an attribute module maybe for translation purpose like

<my_custom_module module="[module_name]">
    <title>My Custom Module</title>
    <sort_order>0</sort_order>
    <action>my_custom_module/adminhtml_order</action>
</my_custom_module>

for this I've replaced [module_name] with my_custom_module, myCustomModule, mycustommodule and Company_MyCustomModule but none of them work, even the page stops loading due to error. so my question is what could be the possible [module_name] to be passed here?

In case you may be asking for it

<admin>
    <routers>
        <my_custom_module>
            <use>admin</use>
            <args>
                <module>Company_MyCustomModule</module>
                <frontName>my_custom_module</frontName>
            </args>
        </my_custom_module>
    </routers>
</admin>
share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

The name that is used in the node attribute module should normally be lower case and will match the the helper definition in the config.xml. If you set this wrong the error that you will get will be that it cannot find the helper.

<global>
    <helpers>
        <your_custom>
            <class>Your_Custom_Helper</class>
        </your_custom>
    </helpers>
</global>

This will mean that your code should be updated to:

<my_custom_module module="your_custom">
    <title>My Custom Module</title>
    <sort_order>0</sort_order>
    <action>my_custom_module/adminhtml_order</action>
</my_custom_module>

A good tutorial on adding menu items can be found at codegento

share|improve this answer
1  
Thanks for your answer... It was confusing because of the attribute name (module). It supposed to be helper to make some sense. Isn't it? –  Mohammad Faisal Jul 10 at 7:30
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.