0

I am trying to create tabs in magento admin panel but it is not working. I tried running all the commands and cache clear. Please check if everything is fine with the code `

<system>
    <tab id="mymodule" translate="label" class="a-custom-css-class-to-style-this-tab" sortOrder="10">
        <label>A meaningful label</label>
    </tab>

    <section id="blog" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="10" translate="label">
        <label>A meaningful section label</label>
        <tab>mymodule</tab>
        <group id="general" translate="label" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>A meaningful group label</label>
            <comment>An additional comment helping users to understand the effect when configuring the fields defined in this group.</comment>

            <field id="enable" translate="label" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1" type="select">
                <label>Feature Flag Example</label>
                <comment>This field is an example for a basic yes or no select.</comment>
                <tooltip>Usually these kinds of fields are used to enable or disable a given feature. Other fields might be dependent to this and will only appear if this field is set to yes.</tooltip>
                <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
            </field>
        </group>
    </section>
</system>

`

And also created etc/config.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
    <default>
        <blog>
            <general>
                <enable>Yes</enable>
            </general>
        </blog>
    </default>
</config>

Please let me know what I am doing or what can be the possible solution

2 Answers 2

1

I think this might may be helpful for you

https://meetanshi.com/blog/create-a-tab-and-load-grid-in-magento-2-customer-admin-edit-page/

But you can check the directory path, because there is some minor mistake that produce this problem.

1
  • Thanks @rana zain , I found the issue , I was missing <resource> node in <section>. after focusing on the code I found this Jul 25 at 5:18
0

I found the issue for the solution that I was missing <resource> node in <section>

Hope this answer can help others in case you face in future

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.