1

I'm trying to add a simple tab to the system configuration in Magento CE 1.8.0.0. It's not showing at all with my code, as follows:

File: app/code/community/Test/Module/etc/adminhtml.xml

<?xml version="1.0"?>
<config>
    <acl>
        <resources>
            <all>
                <title>Allow Everything</title>
            </all>
            <admin>
                <children>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <test_module translate="title" module="test_module">
                                        <title>Test Tabs Section</title>
                                        <sort_order>999</sort_order>
                                    </test_module>
                                </children>
                            </config>
                        </children>
                    </system>
                </children>
            </admin>
        </resources>
    </acl>
</config>

File: app/code/community/Test/Module/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Test_Module>
            <version>0.1.0</version>
        </Test_Module>
    </modules>
    <global>
        <helpers>
            <test_module>
                <class>Test_Module_Helper</class>
            </test_module>
        </helpers>
    </global>
</config>

File: app/code/community/Test/Module/etc/system.xml

<?xml version="1.0"?>
<config>
    <tabs>
        <test_module translate="label" module="test_module">
            <label>Test Module</label>
            <sort_order>999</sort_order>
        </test_module>
    </tabs>
</config>

File: app/code/community/Test/Module/Helper/Data.php

<?php
class Test_Module_Helper_Data extends Mage_Core_Helper_Data
{}

File: app/etc/modules/Test_Module.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Test_Module>
            <active>true</active>
            <codePool>community</codePool>
            <depends>
                <Mage_Adminhtml />
            </depends>
        </Test_Module>
    </modules>
</config>

I'm expecting an empty tab in the admin's system configuration section, but nothing shows at all. I have emptied the cache and re-logged several times. What am I doing wrong? Thanks!

1 Answer 1

2

A tab does not appear if you don't have sections in it (most probably).
Add a section with at least a group and a field in it.
[EDIT] Here is my system.xml that worked:

<?xml version="1.0"?>
<config>
    <tabs>
        <test_module translate="label" module="test_module">
            <label>Test Module</label>
            <sort_order>999</sort_order>
        </test_module>
    </tabs>
    <sections>
        <test_module translate="label" module="test_module">
            <label>Test</label>
            <tab>test_module</tab>
            <frontend_type>text</frontend_type>
            <sort_order>400</sort_order>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>
            <groups>
                <settings translate="label">
                    <label>Settings</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>
                        <enabled translate="label">
                            <label>Enabled</label>
                            <frontend_type>select</frontend_type>
                            <source_model>adminhtml/system_config_source_yesno</source_model>
                            <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>
                        </enabled>
                    </fields>
                </settings>
            </groups>
        </test_module>
    </sections>
</config>
7
  • Thx Marius, tried that but still nothing. I have this same module (empty tab) working in CE 1.7.0.2
    – Jongosi
    Oct 29, 2013 at 10:44
  • @Jongosi Did you try to log out and relogin?
    – Marius
    Oct 29, 2013 at 10:54
  • Yes, many times :(
    – Jongosi
    Oct 29, 2013 at 11:05
  • @Jongosi I've tested with you code and indeed the new tab does not appear. But, like I've said in my answer, If you add a section with a group and a field (at least) everything works great. If you say that your code worked with 1.7 (I've never tried and empty tab before) I can conclude that something changed in 1.8.
    – Marius
    Oct 29, 2013 at 11:14
  • Thx Marius, could u please paste your sample section, group and field code in your answer - I can't get mine to work? Thanks!
    – Jongosi
    Oct 29, 2013 at 11:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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