2

I developed a extension which has configuration options in the backend.

Is it possible to add another section to it from another extension?

enter image description here

This is the system.xml file from the first extension:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <tabs>
        <newsletterpopup_config translate="label" module="fekete_newsletterpopup">
            <label>Fekete</label>
            <sort_order>100</sort_order>
        </newsletterpopup_config>
    </tabs>
    <sections>
        <newsletterpopup_options translate="label" module="fekete_newsletterpopup">
            <label>Newsletter Popup</label>
            <tab>newsletterpopup_config</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>
                <general translate="label">
                    <label>Allgemein</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>
                        <is_active translate="label comment">
                            <label>Aktiv</label>
                            <comment>Das Popup live schalten.</comment>
                            <frontend_type>select</frontend_type>
                            <validate>required-entry</validate>
                            <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>
                        </is_active>
                        <type translate="label comment">
                            <label>Anzeigetyp</label>
                            <comment>Festlegen ob das Popup pro Sitzung angezeigt werden soll oder einmal und nie wieder.</comment>
                            <frontend_type>select</frontend_type>
                            <validate>required-entry</validate>
                            <source_model>fekete_newsletterpopup/options</source_model>
                            <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>
                        </type>
                        <show_popup_to_guest translate="label comment">
                            <label>Popup auch Gästen zeigen</label>
                            <comment>Wenn Nein ausgewählt wurde, wird das PopUp nur angemeldeten Benutzern gezeigt.</comment>
                            <frontend_type>select</frontend_type>
                            <validate>required-entry</validate>
                            <source_model>adminhtml/system_config_source_yesno</source_model>
                            <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>
                        </show_popup_to_guest>
                        <time_until_popup_shows translate="label comment">
                            <label>Zeit bis Popup erscheint</label>
                            <comment>Sekunden</comment>
                            <frontend_type>text</frontend_type>
                            <validate>required-entry validate-digits validate-digits-range digits-range-0.0-1000</validate>
                            <sort_order>40</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </time_until_popup_shows>
                   </fields>
                </general>
                <content translate="label">
                    <label>Inhalt</label>
                    <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>
                    <fields>
                        <header_title translate="label comment">
                            <label>Header Titel</label>
                            <frontend_type>text</frontend_type>
                            <validate>required-entry</validate>
                            <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>
                        </header_title>
                        <content translate="label comment">
                            <label>Inhalt HTML</label>
                            <frontend_type>textarea</frontend_type>
                            <validate>required-entry</validate>
                            <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>
                        </content>
                   </fields>
                </content>
                <appearance translate="label">
                    <label>Erscheinung</label>
                    <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>
                    <fields>
                        <animation translate="label comment">
                            <label>Animations Effekt</label>
                            <comment>Animation</comment>
                            <frontend_type>select</frontend_type>
                            <validate>required-entry</validate>
                            <source_model>fekete_newsletterpopup/effects</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>
                        </animation>
                        <use_random_effect translate="label comment">
                            <label>Zufällige Animation</label>
                            <comment>Zufällige Animation verwenden?</comment>
                            <frontend_type>select</frontend_type>
                            <source_model>adminhtml/system_config_source_yesno</source_model>
                            <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>
                        </use_random_effect> 
                        <header_background_color translate="label comment">
                            <label>Header Hintergrund Farbe</label>
                            <comment>Hex Code</comment>
                            <frontend_type>text</frontend_type>
                            <validate>required-entry color</validate>
                            <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>
                        </header_background_color> 
                        <header_text_color translate="label comment">
                            <label>Header Text Farbe</label>
                            <comment>Hex Code</comment>
                            <frontend_type>text</frontend_type>
                            <validate>required-entry color</validate>
                            <sort_order>40</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </header_text_color> 
                   </fields>
                </appearance>
            </groups>
        </newsletterpopup_options>          
    </sections>
</config>

This is the system.xml from my new extension which should add a section:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <sections>
        <fekete_switch_options translate="label" module="fekete_switch">
            <label>Switch</label>
            <tab>newsletterpopup_config</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>
                <startseite translate="label">
                    <label>Startseite</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>
                        <is_active translate="label comment">
                            <label>Slider</label>
                            <comment>Slider auf der Startseite anzeigen.</comment>
                            <frontend_type>select</frontend_type>
                            <validate>required-entry</validate>
                            <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>
                        </is_active>
                   </fields>
                </startseite>
            </groups>
        </fekete_switch_options>            
    </sections>
</config>

But I get a blank page, if I go to System -> Configuration.

3
  • Can you add the default system.xml to your question which is used by that module? Jul 4, 2018 at 9:01
  • Change the sort order. Also delete the cache directory and try again Jul 4, 2018 at 9:29
  • @SukumarGorai, Thats already all system.xml's
    – Black
    Jul 4, 2018 at 9:37

3 Answers 3

2
+50

The issue seems to be with your system.xml file in Fekete_Switch module.

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <sections>
        <fekete_switch_options translate="label" module="fekete_switch">

here, you are using module as fekete_switch which is not correct and that is the reason you are getting a blank page.

Go to your config.xml file of your module Fekete_Switch and check for the tag name you have used for your helper.

<?xml version="1.0"?>
<config>
  <modules>
    <Fekete_Switch>
      <version>0.1.0</version>
    </Fekete_Switch>
  </modules>
  <global>
    <helpers>
      <switch> <!-- Use this as your module name in system.xml file -->
        <class>Fekete_Switch_Helper</class>
      </switch>
    </helpers>
  </global>
</config> 

Use module as the helper tag e.g(switch) and your problem will most probably get resolved.

Don't forget to clear cache and logout and login to admin panel.

1

Yes, this is possible without any issue.

As an example you can see app/code/core/Mage/Sitemap/etc/system.xml which adds a Google Sitemap link to the catalog tab.

Here is part of the app/code/core/Mage/Catalog/etc/system.xml which defines the catalog tab and the Catalog section:

<?xml version="1.0"?>
<config>
    <tabs>
        <catalog translate="label" module="catalog">
            <label>Catalog</label>
            <sort_order>200</sort_order>
        </catalog>
    </tabs>
    <sections>
        <catalog translate="label" module="catalog">
            <class>separator-top</class>
            <label>Catalog</label>
            <tab>catalog</tab>
            <frontend_type>text</frontend_type>
            <sort_order>40</sort_order>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>
            ...

And here is part of the content of the app/code/core/Mage/Sitemap/etc/system.xml which adds the Google Sitemap Section to the Catalog Tab which is defined in the above snippet:

<?xml version="1.0"?>
<config>
   <sections>
        <sitemap translate="label" module="sitemap">
            <label>Google Sitemap</label>
            <tab>catalog</tab>
            <frontend_type>text</frontend_type>
            <sort_order>70</sort_order>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>
            ...

It is possible your group or fields code is incorrect somewhere, so go through step by step making sure each step works before you continue.

1

Try this:

<?xml version="1.0"?>
<config>
    <sections>
        <fekete_switch_options>
            <label>Switch</label>
            <tab>newsletterpopup_config</tab>
            <sort_order>200</sort_order>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>
            <groups>
                <startseite translate="label">
                    <label>Startseite</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>
                        <is_active translate="label">
                            <label>Slider</label>
                            <comment>Slider auf der Startseite anzeigen.</comment>
                            <frontend_type>select</frontend_type>
                            <validate>required-entry</validate>
                            <source_model>adminhtml/system_config_source_yesno</source_model>
                            <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>
                        </is_active>
                   </fields>
                </startseite>
            </groups>
        </fekete_switch_options>
    </sections>
</config>

Note: Clear all cache & logout you admin user & again login after check

Your Answer

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

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