Search code examples
magentomagento-backend

Move magento module from navigation menu to a tab in the admin configuration


I have a widget grid type module, which i want to move into magento system config.

I have added the following into my system.xml:

<config>
    <sections>
        <customesetup>
            <groups>
                <serialnumbervalidator>
                    <label>Serial Numbers</label>
                    <sort_order>20</sort_order>
                    <expanded>1</expanded>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <frontend_class>complex</frontend_class>
                    <frontend_model>mymodule/adminhtml_serial</frontend_model>

                </serialnumbervalidator>
            </groups>
        </customesetup>
    </sections>
</config>

but apparently it shows nothing. as the Block extends Mage_Adminhtml_Block_Widget_Grid_Container .

If anyone can point me where to look for my answer this would be great (Did searches and did not find anything useful).


Solution

  • You have to modify your config.xml, to show this up in System Configuration section.

        <adminhtml>
            <acl>
                <resources>
                    <admin>
                        <children>
                            <system>
                                <children>
                                    <config>
                                        <children>
                                            <YOUR_MODULE translate="title">
                                                <title><![CDATA[MY TITLE]]></title>
                                                <sort_order>2100</sort_order>
                                            </YOUR_MODULE>
                                        </children>
                                    </config>
                                </children>
                            </system>
                        </children>
                    </admin>
                </resources>
            </acl>
    [...]
    </adminhtml>
    

    And in your system.xml :

        <config>
            <tabs>
                <YOUR_MODULE_tab translate="label" module="YOUR_MODULE">
                    <label>YOUR_MODULE</label>
                    <sort_order>150</sort_order>
                    <class>container_admin_img</class> /*optionnal*/
                </YOUR_MODULE_tab>
            </tabs>
            <sections>
                <customesetup>
                    <groups>
                        <serialnumbervalidator>
                            <label>Serial Numbers</label>
                            <sort_order>20</sort_order>
                            <expanded>1</expanded>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                            <frontend_class>complex</frontend_class>
                            <frontend_model>mymodule/adminhtml_serial</frontend_model>
    
                        </serialnumbervalidator>
                    </groups>
                </customesetup>
            </sections>
       </config>
    

    Hope this helps.

    Take a look at Alan Storm's No Frills Magento Layout book, or on his website : http://alanstorm.com/category/magento