4

login and after login logo not appearedHow to change default logo of magento admin panel

HomePage

1
  • To modify the default admin logo with custom theme, check here.
    – Pratik Oza
    Commented Dec 17, 2017 at 6:52

8 Answers 8

19

There is no setting to change Magento's backend logo. If you want, you can change it by replacing at:

<magento_root>/pub/static/adminhtml/Magento/backend/en_US/images/magento-logo.svg

Note: Where <magento_root> is the path of your Magento installation.

Update: As @matinict said, above solution is not a permanent solution. So below is the correct approach.

First, you need to create a custom admin theme and then change the logo.

Steps are listed below:

  1. app/code/[VendorName]/[ModuleName]/registration.php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    '[VendorName]_[ModuleName]',
    __DIR__
);
  1. app/code/[VendorName]/[ModuleName]/etc/module.xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="[VendorName]_[ModuleName]" setup_version="1.0.0">
        <sequence>
            <module name="Magento_Theme"/>
        </sequence>
    </module>
</config>
  1. app/code/[VendorName]/[ModuleName]/etc/di.xml
<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">[VendorName]/[themename]</item>
            </argument>
        </arguments>
    </type>
</config>
  1. app/design/adminhtml/[VendorName]/[themename]/registration.php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::THEME,
    'adminhtml/[VendorName]/[themename]',
    __DIR__
);
  1. app/design/adminhtml/[VendorName]/[themename]/theme.xml
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>Theme Title</title>
    <parent>Magento/backend</parent>
</theme>
  1. app/design/adminhtml/[VendorName]/[themename]/Magento_Backend/layout/admin_login.xml
<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/login-logo.svg</argument>
            </arguments>
        </referenceBlock>
    </body>
</page>
  1. Upload app/design/adminhtml/[VendorName]/[themename]/web/images/login-logo.svg

  2. app/design/adminhtml/[VendorName]/[themename]/Magento_Backend/layout/default.xml

<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>
  1. Upload app/design/adminhtml/[VendorName]/[themename]/web/images/menu-logo.svg

  2. Magento CLI

php bin/magento setup:upgrade
php bin/magento setup:di:compile

Note: You can change the names of logo files in the configuration file if you want to use PNG files instead of SVG for the logo.

Note: Reference taken from Magento admin logo change!

3
  • But in chrome it look like this. The logo won't appear in chrome Commented Jul 25, 2016 at 9:30
  • Convert your image into .svg file
    – Jaimin
    Commented May 22, 2017 at 10:16
  • its not permanent sulotion
    – matinict
    Commented May 15, 2018 at 7:06
5

Logo is coming up from magento2-base/setup/pub/images/magento-logo.svg .

2
  • But in chrome it look like this. The logo won't appear in chrome Commented Jul 25, 2016 at 9:30
  • Very nice. It worked for me. thanks for saving my time. Commented Sep 5, 2017 at 11:00
3

in magento 2, changing logo in pub/static folder is not an appropriate option, to change Admin Section logo you need to create an admin theme :

Step 1 : create your theme folder: app/design/adminhtml/[Vendorname]/[Theme-name]/

Step 2 : create theme registration.php and theme.xml files within [Theme-name] folder.

content for registration.php

<?php
 \Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::THEME,
'adminhtml/[Vendorname]/[Theme-name]',
__DIR__
);

content for theme.xml

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>My Admin Theme</title>
<parent>Magento/backend</parent>
</theme>

Step 3 : Create folder Magento-Theme and layout: app/design/adminhtml/[Vendorname]/[Theme-name]/Magento_Theme/layout/

Step 4 : create default.xml with code below :

<?xml version="1.0"?>
<!--
/**
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <title>Admin Title</title>
</head>
<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/my-logo.svg</argument>
                <argument name="logo_alt" xsi:type="string">My Admin  Panel</argument>
            </arguments>
        </block>            
    </referenceContainer>
</body>

Step 5 : upload your logo (my-logo.svg) in web/images folder:

upload path: app/design/adminhtml/[Vendorname]/[Theme-name]/web/images/

That's it.. Now upload your theme and run and clear cache "Flush Cache Storage"

Hope this will help !

4
  • missing the </theme> in the theme.xml file (it generates an error). Other then that, this works. Commented Nov 16, 2017 at 23:01
  • Thanks @Spyrule for pointing out, sorry </theme> tag was missed from code block. Commented Nov 30, 2017 at 7:05
  • good logic but not work for me
    – matinict
    Commented May 15, 2018 at 6:52
  • Works great for me on 2.4.3-pl. Commented Sep 23, 2022 at 15:02
0

credits : @adnan Khaliq

Very Simple to change the magento backend logo.

  1. right click on the magento backend logo.
  2. click on ' copy image address'
  3. paste it in the browser. you will get the exact logo address in the address bar.
  4. follow the path in ftp/cpanel/file-zilla and upload your logo.
1
  • But in chrome it look like this. The logo won't appear in chrome Commented Jul 25, 2016 at 9:30
0

Here the URLs list for the Magento admin & login box

To overwrite the img follow the docs: http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/themes/theme-general.html

The Pub folder and files are generated by Magento dinamically.

-

[![logos login][2]][2]

0

On the page "Create an Admin theme" there is a section "Admin theme logo (optional)", where is described creating "admin_login.xml" file for "admin-index" page (log-in) for changing logo in the "log-in form". With creating "admin_login.xml" file, its content and applying there are no problems. Custom logo is used.
In that section there is a reference to "Declaring theme logo", where the procedure of changing a default logo is described, which is displayed on the page "admin-dashboard" in the top left corner.
For declaring a new logo a file "default.xml" is used, where in the tag "argument" a wrong value of the attribute "name" is written.
Instead of "logo_image_src" there is written "logo_file", using of which doesn't change the logo, that is displayed on the page "admin-dashboard" in the top left corner.
Changing the "name"-attribute value from "logo_file" to "logo_image_src" corrects the situaton and small logo is also changed.

Don't forget about:

  1. sudo bin/magento setup:upgrade
  2. sudo bin/magento setup:static-content:deploy -f
  3. sudo bin/magento cache:flush

Update.
In "frontend" area the situation with "name"-attribute value of the "argument"-tag in the file "default.xml" is opposite. Working value is "logo_file", as it is shown on the web-site, and the value "logo_image_src" doesn't change the logo. Other tags work, for example, "argument"-tag where "name"-attribute value is "logo_alt".
I don't know the reason why it happens so. But in my "Magento 2" admin theme "logo_image_src" value works in files "admin_login.xml" and "default.xml". And in frontend area in the file "default.xml" the value "logo_file" works.

0

Create New Module, example, app/code/Theshreyas/Adminlogo

place your image in the following path : Theshreyas/Adminlogo/view/adminhtml/web/images/logo-wide.png create Theshreyas/Adminlogo/view/adminhtml/layout/admin_login.xml with following content

<?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">
    <update handle="styles" />
    <body>
        <referenceBlock name="logo">
            <arguments>
                <argument name="logo_image_src" xsi:type="string">Theshreyas_Adminlogo/images/logo-wide.png</argument>
            </arguments>
        </referenceBlock>
    </body>
</page> 

for changing other custom admin logos check my module

0

At the my case, i create a adminhtml theme and upload images with the same name inside the location.

'app/design/adminhtml/[Vendorname]/[Theme-name]/web/images/'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.