1

I am trying to add a tab to my system | config. I have got this code (from the magento university free video) and have commented each line with my understanding of what each line does (its for future reference, but should help to display any of my misunderstandings), but the tab I expected to see does not show. What have I done wrong?

namespace/module/etc/system.xml

<config>
<tabs><!--creates tabs on the adminhtml page-->
    <training translate="label" module="training">
        <label>Training</label><!--creates a tab with the title of Training (a menu's title is called title a tabs title is called training)-->
        <sort_order>102</sort_order><!--the order of the tab-->
    </training>
</tabs>

<sections><!--creates a section on under the tab called animal-->
    <training_animal translate="label" module="training"><!--maps to <config><tabs><training> in this xml doc (system.xml)-->
        <label>Animal</label><!--names the bar animal-->
        <sort_order>10</sort_order><!--order of the bar-->
        <tab>Training</tab><!--what does this affect?-->
        <show_in_default>1</show_in_default><!--shows this tab in a website scope-->
        <show_in_website>1</show_in_website><!--shows this tab in a website scope-->
        <show_in_store>1</show_in_store><!--shows this tab in a website scope-->
        <groups><!--sets the blue bar in the main content area of the page-->
            <general translate="label" module="training">
                <label>General Settings</label><!--sets the blue bars title-->
                <sort_order>10</sort_order><!--sets the order of the bar-->
                <show_in_default>1</show_in_default><!--shows this tab in a website scope-->
                <show_in_website>1</show_in_website><!--shows this tab in a website scope-->
                <show_in_store>1</show_in_store><!--shows this tab in a website scope-->
                <fields><!--sets which fields are available in the "general" bar-->
                    <recommendation translate="label comment" module="training">
                        <label>Recommendation</label><!--creates a option called recommentaion-->
                        <frontend_type>text</frontend_type><!--What does this do?-->
                        <sort_order>10</sort_order><!--sets the sort order of this field-->
                        <show_in_default>1</show_in_default><!--shows this tab in a website scope-->
                        <show_in_website>1</show_in_website><!--shows this tab in a website scope-->
                        <show_in_store>1</show_in_store><!--shows this tab in a website scope-->
                        <depends><!--This refers to <show_recommendations> node and is required for <show_recommendations> to be displayed-->
                            <show_recommendations>1</show_recommendations>
                        </depends>
                        <comment><![CDATA[<strong>This</strong> is a comment]]></comment><!--what does this do?-->
                    </recommendation>
                    <show_recommendation translate="label" module="training">
                        <label>Display Recommendations</label><!--creates a option called display recommentaion-->
                        <frontend_type>select</frontend_type><!--whats this do?-->
                        <source_model>training/system_config_source_show</source_model><!--sets the source model tha will be used?-->
                        <sort_order>20</sort_order><!--sets the order-->
                        <show_in_default>1</show_in_default><!--shows this tab in a website scope-->
                        <show_in_website>1</show_in_website><!--shows this tab in a website scope-->
                        <show_in_store>1</show_in_store><!--shows this tab in a website scope-->
                        <tooltip>More Javascript in use!</tooltip><!--shows text on hover-->
                    </show_recommendation>
                </fields>
            </general>
        </groups>            
    </training_animal>
</sections>

4

I think you need to use <tab>training</tab> instead of <tab>Training</tab>

  • You were right, thankyou. As you will see that is one of the tabs I could not work out what it did or where it referenced, could you shed some light on why that needed to be lowercase please – tony09uk Sep 9 '13 at 12:38
  • It is because you defined the tab name as lowercase. <training translate="label" module="training"> – Tuong Le Sep 9 '13 at 12:49

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.