0

I want to make several different sections in the left admin menu. I want one section for each module. I have two modules. Just like there is tab General, and under General, there is General, Web, Design, Currency Setup, etc... I want to make my own tab called About, and several different sections under it, which I will call Myself, I and Me. Now, I know how to make one section under one tab, but I can't make more sections under that first tab, only when this first section is clicked, more groups show in the main content. I want more sections to be visible under the menu tab (About) BEFORE this first section is clicked.

2
  • is this for the edit product page or for the system->configuration page? – Marius Dec 5 '16 at 14:39
  • system -> Configuration page – Vladimir Despotovic Dec 5 '16 at 14:40
1

Create a system.xml file in your module with this content:

<?xml version="1.0"?>
<config>
    <tab>
        <about translate="label">
            <label>About</label>
            <sort_order>2000</sort_order><!-- play with this value to arrange it where you want -->
        </about>
    </tabs>
    <sections>
        <myself translate="label">
            <class>separator-top</class>
            <label>Myself</label>
            <tab>about</tab>
            <frontend_type>text</frontend_type>
            <sort_order>10</sort_order>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>
            <groups>
                <group1 translate="label">
                    <label>Group 1 label</label>
                    <frontend_type>text</frontend_type>
                    <sort_order>10</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <fields>
                        <field1 translate="label">
                            <label>Field1 label</label>
                            <frontend_type>text</frontend_type>
                            <sort_order>1</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </list_mode>
                    </fields>
                </group1>
            </groups>
        </myself>
        <i translate="label">
            <label>I</label>
            <tab>about</tab>
            <frontend_type>text</frontend_type>
            <sort_order>20</sort_order>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>
            <groups>
                <group1 translate="label">
                    <label>Group 1 label</label>
                    <frontend_type>text</frontend_type>
                    <sort_order>10</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <fields>
                        <field1 translate="label">
                            <label>Field1 label</label>
                            <frontend_type>text</frontend_type>
                            <sort_order>1</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </list_mode>
                    </fields>
                </group1>
            </groups>
        </i>
        <me translate="label">
            <label>Me</label>
            <tab>about</tab>
            <frontend_type>text</frontend_type>
            <sort_order>30</sort_order>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>
            <groups>
                <group1 translate="label">
                    <label>Group 1 label</label>
                    <frontend_type>text</frontend_type>
                    <sort_order>10</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <fields>
                        <field1 translate="label">
                            <label>Field1 label</label>
                            <frontend_type>text</frontend_type>
                            <sort_order>1</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </list_mode>
                    </fields>
                </group1>
            </groups>
        </me>
    </sections>
</config>
3
  • I want to have two sections (or tabs, I am not clear on the terminology here) under the same title ("About"), and I want each to be defined in its own module. – Vladimir Despotovic Dec 5 '16 at 16:50
  • 1
    i don't really understand. can you post a screenshot in the question with what you are trying to achieve? – Marius Dec 5 '16 at 16:56
  • I want to have two system.xml files (one in each of the two modules). First one to add one subtitle in the menu, and the second to add the other subtitle (under the same title). Or - in the example above with "Me", "Myself" and "I" - I want to have three system.xml files (one in each of the three modules). 1st one to add 1st subtitle in the menu, the 2nd one to add the 2nd subtitle (under the same title), and 3rd to add the 3rd subtitle in the main menu item (title). In other words, I want to defactor your xml that you gave me, which is correct otherwise. – Vladimir Despotovic Dec 5 '16 at 16:58
0

I solved it. The biggest problem is that I didn't log out and log in back again to see the proper changes. So, in order to make two modules have their own menu section each (two in total) and have these menu sections grouped under the same tab, these are the steps to do:
1. Have acl permissions declared in their respective adminhtml.xml. For moduleone (do the similar for moduletwo):

<config>
    <acl>
        <resources>
            <admin>
                <children>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <moduleone translate="title" module="moduleone">
                                        <title>moduleone</title>
                                    </moduleone>
                                </children>
                            </config>
                        </children>
                    </system>
                </children>
            </admin>
        </resources>
    </acl>
</config>

2. Define a new tab within at least one of the modules' system.xml, like so:

<config>
...
<tabs>
    <that_mutual_tab translate="label" module="moduleone">
        <label>Moduleone</label>
        <sort_order>100</sort_order>
    </that_mutual_tab>
</tabs>
...
</config>

3. Inside their respective system.xml(s), define their respective sections under the same tab. For "moduleone":

<config>
...
<sections>
    <moduleone translate="label" module="moduleone">
        <label>moduleone settings</label>
        <tab>that_mutual_tab</tab>
        <sort_order>1000</sort_order>
        <show_in_default>1</show_in_default>
        <show_in_website>1</show_in_website>
        <show_in_store>1</show_in_store>
        <groups>
        ...
        </groups>
    </moduleone>
</sections>
...
</config>

For "moduletwo":

<config>
...
<sections>
    <moduletwo translate="label" module="moduletwo">
        <label>moduletwo settings</label>
        <tab>that_mutual_tab</tab>
        <sort_order>1000</sort_order>
        <show_in_default>1</show_in_default>
        <show_in_website>1</show_in_website>
        <show_in_store>1</show_in_store>
        <groups>
        ...
        </groups>
    </moduletwo>
</sections>
...
</config>

4.Log out and log in again for the ACL changes to take effect and you should have two sections together under the same tab ("that_mutual_tab" in the example.).

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.