3

Is there any possibility to hide a menu related to a custom module in the admin side when the custom module is deactivated using the system config options written in the system.xml of the magento.

Please anyone help me.

4

As mentioned in comments to OP question, this is a duplicate of Possible to hide admin menu if custom module is disabled?

but placed as answer to respond to OP's comments.

You will place the <depends> in the menu item configuration, as such:

(code example taken from ecomdev's post mentioned in the noted duplicate answer)

     <menu>
        <mycustom_menu translate="title" module="[module_name]">
            <!-- this depends will hide the entire menu option -->
            <depends>
              <config>payment/checkmo/active</config>
            </depends>
            <title>My Custom Menu Item</title>
            <sort_order>300</sort_order>
            <children>
                <!-- child items go here -->
                <subitem translate="title" module="[module_name]">
                    <!-- this depends will hide the sub menu option -->
                    <depends>
                       <module>payment/checkmo/active</module>
                    </depends>
                    <title>Subitem</title>
                    <sort_order>10</sort_order>
                    <action>adminhtml/mycustom_controller/</action>
                </subitem>
            </children>
        </mycustom_menu>
    </menu>
| improve this answer | |
  • but this is not worked for me – amesh Feb 13 '14 at 6:22
  • can you add your actual code to the question please – ProxiBlue Feb 13 '14 at 7:07
  • 1
    when i replace the <module> by<config> and place the config value its worked for me.... – amesh Feb 13 '14 at 7:36
  • Great, my bad cut and paste, sorry – ProxiBlue Feb 13 '14 at 7:42

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.