Magento – Magento 2 – how to create a new tab in admin user edit page admin-paneladmin-usermagento2tabs I want to create a new tab under User Role tab. Can anyone help me on how to create those types of tab in admin panel. Please !! Best Answer For example, You have to create new module and layout file adminhtml_user_edit. Namespace/Module/view/adminhtml/layout/adminhtml_user_edit.xml <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.user.editroles"> <block class="Namespace\ModuleName\Block\Adminhtml\Role\Tab\Scope" name="adminhtml.user.tab.test.scope"/> <action method="addTabAfter"> <argument name="name" xsi:type="string">amrolepermissions.scope</argument> <argument name="block" xsi:type="string">adminhtml.user.tab.test.scope</argument> <argument name="after" xsi:type="string">roles</argument> </action> </referenceBlock> </body> Please create this block NameSpace/ModuleName/Block/Adminhtml/Role/Tab/Scope namespace Amasty\Rolepermissions\Block\Adminhtml\Role\Tab; class Scope extends \Magento\Backend\Block\Widget\Form\Generic implements \Magento\Backend\Block\Widget\Tab\TabInterface { const MODE_NONE = 0; const MODE_SITE = 1; const MODE_VIEW = 2; /** * @var \Magento\Store\Model\System\Store */ protected $_systemStore; /** * @var \Magento\Config\Model\Config\Source\Yesno */ private $optionList; /** * @var \Magento\Config\Model\Config\Structure\Element\Dependency\FieldFactory */ private $fieldFactory; public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Data\FormFactory $formFactory, \Magento\Store\Model\System\Store $systemStore, \Magento\Config\Model\Config\Source\Yesno $optionList, \Magento\Config\Model\Config\Structure\Element\Dependency\FieldFactory $fieldFactory, array $data = [] ) { $this->_systemStore = $systemStore; $this->optionList = $optionList; $this->fieldFactory = $fieldFactory; parent::__construct($context, $registry, $formFactory, $data); } /** * Get tab label * * @return \Magento\Framework\Phrase */ public function getTabLabel() { return __('Advanced: Scope'); } /** * Get tab title * * @return string */ public function getTabTitle() { return $this->getTabLabel(); } /** * Whether tab is available * * @return bool */ public function canShowTab() { return true; } /** * Whether tab is visible * * @return bool */ public function isHidden() { return false; } } Related SolutionsMagento 1.9 – New Admin User Current Password It's the current admin password of the user you are logged in with, not the one you are about to create. Magento – Magento 2 – How to add ajax tab on admin user edit page in admin section For example, I add Websites tab Find current tabs reference "adminhtml.user.edit.tabs" https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_edit.xml#L11 Create your module view xml /app/code/Namespace/Module/view/adminhtml/layout/adminhtml_user_edit.xml <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="adminhtml.user.edit.tabs"> <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\Action\Attribute\Tab\Websites" name="tab_websites" template="Magento_Catalog::catalog/product/edit/action/websites.phtml"/> <action method="addTab"> <argument name="name" xsi:type="string">websites</argument> <argument name="block" xsi:type="string">tab_websites</argument> </action> </referenceBlock> </body> </page> Related Topic
Best Answer
For example,
You have to create new module and layout file adminhtml_user_edit.
Namespace/Module/view/adminhtml/layout/adminhtml_user_edit.xml
Please create this block
NameSpace/ModuleName/Block/Adminhtml/Role/Tab/Scope