0

I followed this tutorial https://www.magestore.com/magento-2-tutorial/how-to-create-an-admin-form-look-like-a-configuration-page-magento-2-configuration-p3/#3createa_layout_file_with_url_path.

It shows how to create a setup form for custom modules. However for some reasons it's showing me everything empty, except for the name of the module and Store View.

enter image description here

This is my system.xml

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <tab id="sift" translate="label" sortOrder="10">
            <label>Sift</label>
        </tab>
        <section id="section" translate="label" sortOrder="130" showInDefault="1" showInWebsite="1" showInStore="1">
            <class>separator-top</class>
            <label>Hello World</label>
            <tab>Sift</tab>
            <resource>Vendor_Module::menu_item</resource>
            <group id="sift" >
                <label>General Configuration</label>
                <field id="debug_enable" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Enable Debug</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>

                </field>
            </group>
        </section>
    </system>
</config>

This is my acl.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
    <acl>
        <resources>
            <resource id="Magento_Backend::admin">
                <resource id="Vendor_Module::menu">
                    <resource id="Vendor_Module::menu_item" title="Configuration" sortOrder="80" />
                </resource>
            </resource>
        </resources>
    </acl>
</config>

and finally config.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
    <default>
        <section>
            <sift>
        <debug_enable>1</debug_enable>
            </sift>
        </section>
    </default>
</config>

Please help. Thanks!

  • I think it's your group id and tab id name issue. Can you change that name and check please. – Monark Bhawani Sep 24 at 10:04
  • Hello, I made it worked. I practically redo the whole thing because it was not working, also I could not make work with the controller that I was using, so I changed the action of my menu in menu.xml to adminhtml/system_config/edit/section/(name of the section) – Oscar Vazquez Sep 24 at 15:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.