Magento Expert Forum - Improve your Magento experience

Results 1 to 6 of 6

How To Add Custom Admin Menu In Magento 2

  1. #1
    Junior Member fay_khattak's Avatar
    Join Date
    Jan 2016
    Location
    Karachi, Pakistan
    Posts
    50
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Lightbulb How To Add Custom Admin Menu In Magento 2

    Magento developers look forward to new and modern features in Magento 2 to get the most out of the popular CMS right out-of-the-box. When we talk about Magento 2 ecommerce development, there is always a need for custom options that are required to be placed somewhere in the platform.

    While creating a Magento 2 module, I needed to add a custom admin menu in the Magento 2 Admin Panel. To solve this issue, I spent some time on it and found a solution. In this blog post, I tried to describe how to add a custom admin menu in Magento 2 briefly.

    View more threads in the same category:


  2. #2
    Junior Member
    Join Date
    Aug 2016
    Posts
    41
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default

    Create admin menu file called: menu.xml file

    app/code/Mageplaza/HelloWorld/etc/adminhtml/menu.xml

    with the following content:

    <?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>
    </menu>
    </config>

    Step 2: Add menu item


    <?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="Mageplaza_HelloWorld::helloworld" title="Hello World" module="Mageplaza_HelloWorld" sortOrder="51" resource="Mageplaza_HelloWorld::helloworld"/>
    <add id="Mageplaza_HelloWorld:ost" title="Posts" module="Mageplaza_HelloWorld" sortOrder="10" action="mageplaza_helloworld/post" resource="Mageplaza_HelloWorld:ost" parent="Mageplaza_HelloWorld::helloworld"/>
    <add id="Mageplaza_HelloWorld::hello_configuration" title="Configuration" module="Mageplaza_HelloWorld" sortOrder="99" parent="Mageplaza_HelloWorld::helloworld" action="adminhtml/system_config/edit/section/helloworld" resource="Mageplaza_HelloWorld::helloworld_configu ration"/>
    </menu>
    </config>

    In this example, we will create a level-0 menu named “Hello World” and two sub-menus named “Manage Items” and “Configuration”. The menu.xml file will define a collection of ‘add’ note which will add a menu item to Magento backend. We will see its structure:

    <add id="Mageplaza_HelloWorld:ost" title="Posts" module="Mageplaza_HelloWorld" sortOrder="10" action="mageplaza_helloworld/post" resource="Mageplaza_HelloWorld:ost" parent="Mageplaza_HelloWorld::helloworld"/>

    Step 3: Flush Magento cache

    Make sure it admin menu items are displayed on Magento 2 admin, you should try to flush Magento 2 cache.

    Run the following command line:

    php bin/magento cache:clean

  3. #3
    Junior Member
    Join Date
    Sep 2016
    Posts
    228
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    Simply follow these steps:

    To Create Admin Menu in Magento 2

    Step 1: Create menu.xml
    Step 2: Add menu item
    Step 3: Flush Magento cache



    Book Ad in Times of India | Newspaper Ad Agency in Delhi
    Last edited by vishnu; 13-03-2019 at 08:16 AM.

  4. #4
    Junior Member
    Join Date
    Mar 2017
    Location
    Bangalore
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Refere this url, it can help you: http://www.magestore.com/magento-2-t...-in-magento-2/

  5. #5
    Junior Member
    Join Date
    Sep 2018
    Location
    United Kingdom
    Posts
    635
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Default

    Step 1: Register and name the custom menu item. In the module's root directory, create the record registration.Hypertext Preprocessor. This file registers the module MyCompany_ExampleAdminNewPage.
    Step 2: Create a brand new menu object in the left navigation. Under the created and many others listing, create a new directory known as adminhtml .

  6. #6

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •