0

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.

1

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!

  • Can you please check in your pub/static/adminhtml/Vendor/Theme/Magento_Theme/web/ directory ? If there is old favicon.ico available can you please remove that and then refresh your page ? – Kishan Savaliya Oct 16 at 15:37
  • Is above solution works for you ? – Kishan Savaliya Oct 16 at 16:50
  • there is nothing in that folder, but all of the images on the backend are in a static/version*******/adminhtml folder which won't be cleared. – Ian Richens Oct 16 at 19:07
  • Can you please place your favicon.ico on above mentioned path? And check result in browser's private window once? – Kishan Savaliya Oct 16 at 19:10
  • Otherwise please do inspect element and check from where that image is coming? – Kishan Savaliya Oct 16 at 19:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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