In this blog, we will discuss how to change the admin logo of a Magento 2? For this, you will not need to do any setting. Here we will tell you how easily you can change the logo of your Magento 2 administrator.
To change your Magento 2 admin, follow the step by step guide given below.
For this, you first need to create a custom theme.
Let us tell you that here we have done the custom name of model name Webiators vendor name
Example –
app/code/[VendorName]/[ModuleName]/
app/code/Webiators/CustomChanges/
Step-1
Create app/code/Webiators/CustomChanges/registration.php
1 2 |
<?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Webiators_CustomChanges', __DIR__ );?> |
Step -2 Create app/code/Webiators/CustomChanges/etc/module.xml
1 |
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Webiators_CustomChanges" setup_version="1.0.0"> <sequence> <module name="Magento_Theme"/> </sequence> </module> </config> |
Step -3
Create app/code/Webiators/CustomChanges/etc/di.xml
1 2 |
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Theme\Model\View\Design"> <arguments> <argument name="themes" xsi:type="array"> <item name="adminhtml" xsi:type="string">Webiators/CustomChanges</item> </argument> </arguments> </type> </config> |
Step -4
Create app/design/adminhtml/Webiators/CustomChanges/registration.php
1 |
<?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::THEME, 'adminhtml/Webiators/CustomChanges', __DIR__ );?> |
Step -5
Create app/design/adminhtml/[VendorName]/[themename]/theme.xml
1 2 |
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>Custom Theme</title> <parent>Magento/backend</parent> </theme> |
Step -6
Create app/design/adminhtml/Webiators/CustomChanges/Magento_Backend/layout/admin_login.xml
1 |
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-login" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="styles" /> <body> <referenceBlock name="logo"> <arguments> <argument name="logo_image_src" xsi:type="string">images/adminlogin-logo.png</argument> </arguments> </referenceBlock> </body> </page> |
Step -7 app/design/adminhtml/Webiators/CustomChanges/web/images/adminlogin-logo.png
If you want to change the logo of the admin menu then you also need to follow steps 8 and 9.
Step -8 Create
app/design/adminhtml/Webiators/CustomChanges/Magento_Backend/layout/default.xml
1 |
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="header"> <referenceBlock name="logo"> <arguments> <argument name="logo_img_width" xsi:type="number">300</argument> <argument name="logo_img_height" xsi:type="number">300</argument> <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/menu-logo.svg</argument> </arguments> </referenceBlock> </referenceContainer> </body> </page> |
Step – 9
app/design/adminhtml/[VendorName]/[themename]/web/images/menu-logo.svg
Now Go to SSH
Step -10 Run the Magic Command
php bin/magento setup:upgrade
php bin/magento setup:di:compile
Step -9 Go to your admin login page and see the result.
We hope you find this blog very simple and effective. If you want to get more information related to your Magento 2, then with the help of the comment section given below, you are absolutely free to ask every question related to Magento 2 website. Our Magento Experts are always ready to solve every problem related to your Magento store.
Thank you 😉