Question

I've made the custom adminhtml theme and changed the login logo and the default top left logo on dashboard, however I'm unable to change the admin favicon.

In the default.xml that I'm using to modify the header logo i have added

<head>
    <link src="images/favicon.ico" rel="icon" sizes="32x32" />
</head>

to call a custom favicon that is stored in the app/design/adminhtml/%vendor%/%theme%/web/images/ folder but even though the logos have loaded fine, the favicon remains the same as the front-end.

is there a different string i should be using in the ? i have taken this string directly from the frontend favicon tutorial, so don't know what it would need changing for the adminhtml sections

I have also tested this in the default_head_blocks.xml but that appears to be front-end specific.

Edit:

It appears that the theme is active, (can change .phtml files successfully) but the default.xml and the admin_login.xml are both being ignored anyway. if i remove those files, the logo files with the default names load fine, but with the files in place the newly linked files from the xmls are ignored.

Was it helpful?

Solution

First of all, If you've set favicon from Design Config, you need to remove that icon if you want to display different favicon for front-end and back-end.

So please remove favicon icon from here and save config and then clear cache.

Content > Design > Configuration > Select your Store view and edit > HTML Head > Favicon icon > Remove > Save Config

And if there is not any favicon set then you can copy your favicon.ico from here

pub/media/favicon/stores//favicon.ico

and move that to your frontend theme first here..

app/design/frontend/Vendor/Theme/Magento_Theme/web/favicon.ico

Then after you can use below steps for Backend theme favicon icon.

You can add your favicon.ico image here in your adminhtml theme

app/design/adminhtml/Vendor/Theme/Magento_Theme/web/favicon.ico

Because in default Magento Backend theme that icon available here.

vendor/magento/module-theme/view/adminhtml/web/favicon.ico

If you will add that icon with same name favicon.ico then that will work for you. Then you do not need to make any changes in any other xml files.

Please run below command once

php bin/magento setup:upgrade
php bin/magento cache:clean
php bin/magento cache:flush

Hope this will work for you!

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top