15/08/2022
We use cookies to make your experience better. To comply with the new e-Privacy directive, we need to ask for your consent to set the cookies. Learn more.
We use cookies to make your experience better. To comply with the new e-Privacy directive, we need to ask for your consent to set the cookies. Learn more.
Directory
app/code/VendorName/ModuleName/etc/adminhtml/menu.xml
Content for 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="VendorName_ModuleName::newmenu" title="New Menu" module="VendorName_ModuleName" sortOrder="51" resource="VendorName_ModuleName::newmenu"/>
<add id="VendorName_ModuleName::configuration" title="Configuration" module="VendorName_ModuleName" sortOrder="10" action="vendorname_modulename/configuration" resource="VendorName_ModuleName::configuration" parent="VendorName_ModuleName::newmenu"/>
<add id="VendorName_ModuleName::management" title="Management" module="VendorName_ModuleName" sortOrder="99" parent="VendorName_ModuleName::newmenu" action="vendorname_modulename/management" resource="VendorName_ModuleName::management"/>
</menu>
</config>
Let's explain the attributes:
id
the attribute is the identifier for this note. It’s a unique string and should match the format: {Vendor_ModuleName}::{menu_description}.title
the attribute is the text which will be displayed on the menu bar.module
the attribute has defined the module to which this menu belongs.sortOrder
the attribute has defined the position of the menu. A lower value will display on top of the menu.parent
the attribute is an Id of another menu node. It will tell Magento that this menu is a child of another menu. action
an attribute will define the URL of the page to which this menu links.resource
the attribute is used to define the ACL rule which the admin user must have in order to see and access this menu.To clear cache, run the following command
php bin/magento cache:clean
If you are looking for a Magento developer, visit Magento Developer Agency.