There are some menu items that are unnecessary for us. How can I remove them? Thanks.
Magento 2 – How to Remove Menu Item in Admin Portal
adminhtmlmagento2menu
Related Solutions
In order to change top left logo of the admin menu you have to create in your custom module view/adminhtml/layout/default.xml
file:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="header">
<block class="Magento\Backend\Block\Page\Header" name="logo" before="-">
<arguments>
<argument name="show_part" xsi:type="string">logo</argument>
<argument name="edition" translate="true" xsi:type="string">Community Edition</argument>
<argument name="logo_image_src" xsi:type="string">images/custom-admin-icon.svg</argument>
</arguments>
</block>
</referenceContainer>
</body>
</page>
Place custom-admin-icon.svg
with height 25px and width 41px into CustomModule/view/web/images/custom-admin-icon.svg
For the Admin Login page create new view/adminhtml/layout/admin_login.xml
file:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-login" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="logo">
<arguments>
<argument name="logo_image_src" xsi:type="string">images/custom-admin-logo.svg</argument>
</arguments>
</referenceBlock>
</body>
Feel free to use PNG files instead of SVG.
To remove the main menu from your home page do the following thing
Create your own theme at this location
magento_root\app\design\frontend\Themes_package\theme\
Create a theme folder there at below location
magento_root\app\design\frontend\Themes_package\theme\Magento_Theme
Create a default.xml
file there at below location
magento_root\app\design\frontend\Themes_package\theme\Magento_Theme\layout\default.xml
Put this code there
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="navigation.sections" remove="true"/>
</body>
</page>
This will remove your navigation section
Thank You!
Best Answer
By using remove tag you can remove a menu item from admin menu.
Syntax should be
<remove id="MENU_ITEM_ID" />
Suppose I want to remove Cms page section from menu, then I have to rewrite below code at menu.xml of my module.
Magento_Cms::cms_page is menu id of cms page ,which is define at at vendor/magento/module-cms/etc/adminhtml/menu.xml .