How to create menu section title in adminhtml?
How to create menu section title in adminhtml?
I want to add section (menu items group) into adminhtml menu in Magento 2. Something like this:
I've added file ./etc/adminhtml/menu.xml
with:
./etc/adminhtml/menu.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
<menu>
<add id="Vendor_Module::section"
title="Section"
translate="title"
module="Vendor_Module"
sortOrder="50"
resource="Vendor_Module::section"/>
</menu>
</config>
but I cannot see new section in the adminhtml menu.
3 Answers
3
please update your menu.xml like below:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
<menu>
<add id="Vendor_Module::section" title="Section" module="Vendor_Module" sortOrder="50" resource="Vendor_Module::section"/>
<add id="Vendor_Module::section-subsection" title="Section" module="Vendor_Module" sortOrder="50" resource="Vendor_Module::section" action="section/index/index" parent="Vendor_Module::section"/>
</menu>
</config>
If is still not display please confirm that your module is enable
Please add like this in menu.xml
<menu>
<add id="Test_Menu::parent" title="Menu" module="Test_Menu" sortOrder="100" resource="Test_Menu::parent"/>
<add id="Test_Menu::test" title="First Menu" module="Test_Menu" sortOrder="11" action="router/controller/action" resource="Test_Menu::test" parent="Test_Menu::parent"/>
Add this below the <add>
tag
<add>
<add id="Vendor_Module::section2"
title="Section2"
translate="title2"
module="Vendor_Module"
sortOrder="55"
parent="Vendor_Module::section" action="vendor/module"
resource="Vendor_Module::section"/>
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Can you please update your whole menu.xml code?
– Rutvee Sojitra
Aug 22 at 12:31