views:

1483

answers:

1

Using the Magento Ecommerce system, is is possible to remove an item from the Admin Panel Navigation menu? More generally, is there a way to use the config override system to remove existing elements from a configuration?

I know I can add to the navigation with an override that looks something like this

0.1.0

<adminhtml>
    <menu>
         <cms translate="title" module="cms">
            <title>The CMS</title>
            <sort_order>70</sort_order>
            <children>
                <foo translate="title" module="cms">
                    <title>Foo Item</title>
                    <action>adminhtml/foo</action>
                </foo>
            </children>
         </cms>
    </menu>    
</adminhtml>

but how would/could I completely suppress the CMS navigation item?

+1  A: 

You could inject a bogus module dependency into the menu item in your config.xml.

In your case,

<adminhtml>
  <menu>
    <cms translate="title" module="cms">
      <depends><module>HideMe</module></depends>
    </cms>
  </menu>
</adminhtml>
Scott Moorhouse
Your science impresses me! Will depends work like that in other areas of the config file? I'd only even seen it used to ensure correct module loading order.
Alan Storm
It seems to be only for initializing Magento's modules (as you stated) and building the adminhtml menu. Module dependencies seem to be checked in these classes:Mage_Adminhtml_Block_Page_MenuMage_Adminhtml_Model_ConfigMage_Adminhtml_Model_System_Config_Source_Admin_PageMage_Api_Model_ConfigMage_Core_Model_Config
Scott Moorhouse