Hello Magento Friends,

In today’s blog, we will learn How to Add Custom Tab on Admin Dashboard in Magento 2.

Creating a custom tab on the admin dashboard in Magento 2 can be a useful way to display specific information or tools that are relevant to your business. Here’s a step-by-step guide on how to add a custom tab on the Magento 2 admin dashboard:

Steps to Add Custom Tab on Admin Dashboard in Magento 2:

Step 1: First, we need to create a “routes.xml” file inside the extension at the following path.

app\code\Vendor\Extension\etc\adminhtml\

Then add the code as follows

Step 2: After that, we need to create the “Bestvendors.php” file inside the extension at the following path.

app\code\Vendor\Extension\Controller\Adminhtml\Dashboard

And add the below-mentioned code

Step 3: After that, we need to create a “custom_file.phtml” file inside the extension at the following path.

app\code\Vendor\Extension\view\adminhtml\templates

Now, add the following piece of code

Step 4: After that, we need to create a “di.xml” file inside the extension at the following path.

app\code\Vendor\Extension\etc\adminhtml\

Now add the code as follows

Step 5: After that, we need to create a “Grids.php” file inside the extension at the following path.

app\code\Vendor\Extension\Block\Dashboard\

And include the below code snippet

Step 6: Once all files are created in your Magento, you need to run Magento upgrade, compile and deploy commands as follows.

Output:

“Best Vendor” tab added in the Magento  2 Admin Dashboard.

Custom tab in Magento 2 admin dashboard

Conclusion:

Hence, this way, you can add custom tabs in the admin dashboard of your Magento 2 store.

There are other areas of your Magento 2 store where you can add a custom tab:

If you have any doubts regarding the above steps, feel free to connect with me through the comment section. Share the tutorial with your friends if you found it useful. Stay in touch with us for more such Magento 2 tutorials.

Happy Coding!

Click to rate this post!
[Total: 0 Average: 0]