How to Create Admin Menu in Magento 2
The default Magento 2 admin panel offers a wide range of features to make the task of administrating the store easy and efficient.
However, owing to the modern E-commerce store structure, the admin may also want customization in the admin panel to manage custom-developed features.
The customization in the admin panel comes with custom grids, forms, etc. Now, the admin cannot access these grids or forms or any such custom page from the admin panel without a custom menu.
Hence, you may use the below solution to create admin menu in Magento 2.
For instance, your store offers the feature to subscribe to products that are out of stock for the back-in-stock notification. The admin may want to manage these subscribers from the backend grid which can be accessed using the admin menu created as shown here:
Or, if the Magento 2 store is using any third-party extensions for collecting customer reviews, managing store credits, etc. The admin may want to manage the customer reviews grid or update the store credit using a custom form in the backend. Such grids and forms can be accessed from the admin panel with a custom admin menu only.
Method to Create Admin Menu in Magento 2:
Use the below code in the menu.xml file at app/code/Vendor/Module/etc/adminhtml
1 2 3 4 5 6 7 8 9 10 |
<?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::manage_label" title="Meetanshi" module="Vendor_Module" sortOrder="10" resource="Vendor_Module::manage_label"/> <add id="Vendor_Module::post" title="Manage Label" module="Vendor_Module" sortOrder="10" action="label/index/index" resource="Vendor_Module::post" parent="Vendor_Module::manage_label"/> </menu> </config> |
That’s it.
Any doubts about the above method can be mentioned in the Comments section below.
I’d be happy to help.
Also, do share the solution with Magento 2 store admins via social media.
Thanks.
Sanjay Jethva
Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe.
His passion for Magento 2 and Shopify solutions has made him a trusted source for businesses seeking to optimize their online stores. He loves sharing technical solutions related to Magento 2 & Shopify.
Prev
How to Add Label on all Lines in Street Address in Magento 2 Checkout Page
Top 9 Tips on How to Increase User Sign Ups in E-commerce
Next