1

In /magento1/app/code/local/Maddyboy/Instagramapi/etc/config.xml:

<adminhtml>
  <acl>
    <resources>
      <admin>
        <children>
          <system>
            <children>
              <config>
                <children>
                  <instagramapi translate="title" module="instagramapi">
                    <title>Instagram Slider</title>
                  </instagramapi>
                </children>
              </config>
            </children>
          </system>
        </children>
      </admin>
    </resources>
  </acl>
  <layout>
    <updates>
      <instagramapi>
        <file>instagramapi.xml</file>
      </instagramapi>
    </updates>
  </layout>
</adminhtml>  

In /magento1/app/code/local/Maddyboy/Instagramapi/etc/system.xml:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <tabs>
        <instagramapi translate="label" module="instagramapi">
            <label>Instagram Slider</label>
            <sort_order>1</sort_order>
        </instagramapi>
    </tabs>

    <sections>
        <instagramapi translate="label" module="instagramapi">
            <label>Api Settings</label>
            <tab>instagramapi</tab>
            <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>
            <groups>
                <section_one translate="label">
                    <label>Section One</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>                
                    <fields>
                        <custom_field_one>
                            <label>Custom Text Field</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>
                            <comment>Example of text field.</comment>         
                        </custom_field_one>
                    </fields>
                </section_one>
            </groups>                
        </instagramapi>
    </sections>
</config>

when I enter some dummy data and click on save I got a 404 error.

URL after save: http://127.0.0.1/magento1/index.php/admin/system_config/save/key/3537cf9ef9d3161eb483f8251284d9f9/section/instagramapi_options/ error

errorshot

14
  • why there are two acl tag in config.xml?
    – Piyush
    Commented Oct 24, 2017 at 11:28
  • @Piyush I corrected that mistake still same issue. I updated my code
    – inrsaurabh
    Commented Oct 24, 2017 at 11:31
  • check the url it is redirecting on after save
    – Piyush
    Commented Oct 24, 2017 at 11:33
  • i posted the url above
    – inrsaurabh
    Commented Oct 24, 2017 at 11:38
  • @Piyush Is other file need to be created for backend
    – inrsaurabh
    Commented Oct 24, 2017 at 11:40

2 Answers 2

3

in your config.xml in (or adminhtml.xml) you should have

<acl>
    <resources>
        <all>
            <title>Allow Everything</title>
        </all>
        <admin>
            <children>
                <system>
                    <children>
                        <config>
                            <children>
                                <instagramapi translate="title" module="instagramapi">
                                    <title>Instagram Slider</title>
                                </instagramapi>
                            </children>
                        </config>
                    </children>
                </system>
            </children>
        </admin>
    </resources>
</acl>

Then in your system.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <tabs>
        <instagramapi_tab translate="label" module="instagramapi">
            <label>Instagram Slider</label>
            <sort_order>1</sort_order>
        </instagramapi_tab>
    </tabs>

    <sections>
        <instagramapi translate="label" module="instagramapi">
            <label>Api Settings</label>
            <tab>instagramapi_tab</tab>
            <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>
            <groups>
                <section_one translate="label">
                    <label>Section One</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>                
                    <fields>
                        <custom_field_one>
                            <label>Custom Text Field</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>
                            <comment>Example of text field.</comment>         
                        </custom_field_one>
                    </fields>
                </section_one>
            </groups>                
        </instagramapi>
    </sections>
</config>

Be sure to log off and on again after each change to the acls. If needed, flush the magento cache ("Flush Magento Cache")

2
  • Yes its worked , what is the error in my code
    – inrsaurabh
    Commented Oct 24, 2017 at 12:57
  • Avoid naming the tab the same as the section.... Commented Oct 24, 2017 at 13:14
0

In your config.xml file you have mentioned wrong section node. As per your system.xml your code in config.xml should be changed to below

<instagramapi>
       <title>Instagram Slider</title>
</instagramapi>

Instead of

<instagramapibackend>
       <title>Instagram Slider</title>
</instagramapibackend>
1
  • I updated the code still same issues
    – inrsaurabh
    Commented Oct 24, 2017 at 12:18

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.