<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Magenticians_Newmenu" setup_version="1.0.1"></module> </config>
<?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Magenticians_Newmenu', __DIR__ );
<?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="Magenticians_Newmenu::first_menu" title="My Main Menu" module="Magenticians_Newmenu" sortOrder="20" resource="Magento_Backend::content" /> <add id="Magenticians_Newmenu::second_menu" title="My Sub Menu" module="Magenticians_Newmenu" sortOrder="1" action="newmenu/index/index" parent="Magenticians_Newmenu::first_menu" resource="Magento_Backend::content" /> </menu> </config>Now, here is a short description of the major variables in the above code: id: The unique identifier of the custom admin menu. title: The title that will be shown in the admin menu. Module: in this case, Magenticians_Newmenu sortOrder: Prioritize the placement of the custom admin menu. resource: the rule to identify which admin users can access the custom admin menu. Action: Set the link to the admin controller. parent: Used to define the menu upon which the custom menu depends.
php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento cache:clean php bin/magento cache:flushIt’s time to check the output. Go to the admin panel of your Magento 2 store, and you will see the new admin menu MY MAIN MENU with the nested My Sub Menu in it:
In the highly competitive modern workplace, trust, and employee loyalty are crucial factors for long-term… Read More
In the ever-evolving world of small business developing and implementing effective marketing strategies is critical to… Read More
With one of the highest internet penetration rates, the UAE has set out to revolutionize… Read More
Artificial Intelligence (AI) has been continually evolving, leading to remarkable advancements in various industries. Among… Read More
Extensions, extensions and lots of extensions. We all love extensions, don’t we? After all, extensions… Read More
Software quality is crucial to a firm's success across industries in the quickly changing digital… Read More
View Comments
thanks for providing steps for creating custom admin menu. i have used this steps in my m2 site.
I am Glad that it helps you. You can also check our more tutorials :)
installed successful i can go to store page but error 404 page not found when going to admin