To create Custom Menu in Admin, you need to follow the steps below:
Step 1: Create menu.xml
app/code/Bluethink/CustomMenu/etc/adminhtml/menu.xml
1 2 3 4 5 6 7 |
<?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="Bluethink_CustomMenu::parent" title="Customer Reviews" module="Bluethink_CustomMenu" sortOrder="51" resource="Bluethink_CustomMenu::helloworld"/> <add id="Bluethink_CustomMenu::reviews" title="Manage Reviews" module="Bluethink_CustomMenu" sortOrder="10" action="bluethink_custommenu/reviews" resource="Bluethink_CustomMenu::reviews" parent="Bluethink_CustomMenu::parent"/> </menu> </config> |
Step 2: Flush Magento cache.
php bin/magento cache:clean
Explanation of Attributes.
id–unique identifier
title–Title of the menu that will be showing in the admin menu bar.
module–defined the module which this menu is belong to.
sortOrder–position of the menu.
resource–the rule to identify which admin user can see and access this menu.
action–define the url of the page specified admin controller.
parent–defines menu is child of other menu it depends.
You can download sample module for admin menu here.
bluethinkinc_blog
2022-08-12