6

To create a custom menu in back-end we create adminhtml.xml with following code into this file. My question is which file(s) are responsible to process this adminhtml.xml file to add our new menu item to the menu.

<adminhtml>
        <menu>
            <[module] module="[module]">
                <title>[Module]</title>
                <sort_order>71</sort_order>               
                <children>
                    <items module="[module]">
                        <title>Manage Items</title>
                        <sort_order>0</sort_order>
                        <action>[module]/adminhtml_[module]</action>
                    </items>
                </children>
            </[module]>
        </menu>
        <acl>
            <resources>
                <all>
                    <title>Allow Everything</title>
                </all>
                <admin>
                    <children>
                        <[module]>
                            <title>[Module] Module</title>
                            <sort_order>200</sort_order>
                        </[module]>
                    </children>
                </admin>
            </resources>   
        </acl>
</adminhtml>
9

According to app/design/adminhtml/layout/main.xml this block is loaded for the menu:

<block type="adminhtml/page_menu" name="menu" as="menu"></block>

So that concludes that Mage_Adminhtml_Block_Page_Menu (function _buildMenuArray) takes care of building the menu and processing everything. Of course many different components are used in this block.

| improve this answer | |
  • 4
    Worth noting that this block ooutput is cached in the block_html cache. – benmarks Jan 23 '13 at 16:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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