I am trying to add a menu for my module in the admin panel. I want to add it like Grand Parent > Parent > Child
structure.
I have used below code in my 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::jsutariya" title="Grand Parent" module="Vendor_Module" sortOrder="100" resource="Vendor_Module::jsutariya" />
<add id="Vendor_Module::listgallery" title="Parent" module="Vendor_Module" sortOrder="10" resource="Vendor_Module::listgallery" parent="Vendor_Module::jsutariya" />
<add id="Vendor_Module::settings" title="Child" module="Vendor_Module"
sortOrder="40" action="adminhtml/system_config/edit/section/list_gallery"
resource="Vendor_Module::settings" parent="Vendor_Module::listgallery"/>
</menu>
</config>
But I can only see Grand parent and child menus. Please check below screenshot.
Best Answer
Honestly, I didn't give the proper answer to your question. But found a way to show the parent menu. Actually, Magento is hiding First "parent" menu via CSS. So you need to add another parent menu and will display your previous parent menu. Here is my code:
The main culprit is the following CSS and I don't know why its added in the first place by Magento