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
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.
-
Thanks @rana zain , I found the issue , I was missing <resource> node in <section>. after focusing on the code I found thisCharanjeet Singh– Charanjeet Singh2022年07月25日 05:18:06 +00:00Commented Jul 25, 2022 at 5:18
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
Explore related questions
See similar questions with these tags.