How to Add a New Tab in User Editing Page in Magento 2

Here the following steps explain you how to add a new tab in user editing page in Magento 2:

Step 1: Form the file \app\code\Webnexs\InventorySuccess\


Step 2: Form the file \app\code\Webnexs\InventorySuccess\Observer\


In this article, we will try to add a new tab in to user editing page in Magento 2. We will use the event view_block_abstract_to_html_ before to do it:

Step 1:

We want to form a file:


<?xml version="1.0"?>

<config xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">

   <event name="view_block_abstract_to_html_before">

       <observer name="staff_add_permission_view_block_abstract_to_html_before" instance="Webnexs\InventorySuccess\Observer\Permission\Staff\ViewBlockAbstractToHtmlBefore" />



Step 2:

We will form a file:


Warehouse\ViewBlockAbstractToHtmlBefore.php to call the tab that you want to add:


namespace Webnexs\InventorySuccess\Observer\Permission\Staff

use Magento\Framework\Event\Observer as EventObserver;

use Magento\Framework\Event\ObserverInterface;

class ViewBlockAbstractToHtmlBefore implements ObserverInterface



    * @param EventObserver $observer

    * @return $this


   public function execute(EventObserver $observer)


       $block = $observer->getEvent()->getBlock();

       if($block instanceof \Magento\User\Block\User\Edit\Tabs){




                   'label' => __('Warehouse'),

                   'title' => __('Warehouse'),

                   'after' => __('roles_section'),

                   'content' => $block->getLayout()->createBlock(







       return $this;



After that you will observe like:

insert a new tab

The above mentioned steps describe you how to add New Tab in User Editing Page in Magento 2






Leave a Reply

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