Exploring Magento 2.2 UI Component – Part 3

Exploring Magento 2.2 UI Component – Part 3 Creating Admin Menu and Placeholder for Grid UI Component

In our Last Tutorial Exploring Magento 2.2 UI Component – Part 2 we have created the MODEL & Resource MODEL classes responsible for fetching the custom table data.

In this Tutorial we will create a custom Admin Menu and Admin Controller which is responsible for showing the Grid UI Component

Step 1:-To Display the list data in magento 2 admin panel, we need to create a new Top Level menu. For this example we will keep the Menu name as Upcoming Shows.

Mydons/Tradeshows/etc/adminhtml/menu.xml

The New top level menu should contain a unique id. The value given in the “title” attribute will be displayed in the admin panel. The “action” attribute specifies the frontName controller action. “resource” attribute is also an unique id which is used for admin ACL.
Custom Top Level Admin Menu will look as shown below
TradeShows Admin Menu

Step 2:- Whenever our custom admin top level menu “upcoming shows” is clicked it should go to a controller action. Before creating our Admin controller we need to configure the “frontName” in our case it is “tradeshows”

Mydons\Tradeshows\etc\adminhtml\routes.xml

Since we are defining the router for Admin Area, the “router” id should be mentioned as “admin”

Step 3:- Lets create our admin Controller

Mydons\Tradeshows\Controller\Adminhtml\Index\Index.php

Once the Upcoming Shows Menu is clicked we will get the below output
Upcoming Shows Template

Leave a Comment

Your email address will not be published. Required fields are marked *

seventeen − 12 =