2

I've successfully added a favicon to the site template through the _layout.html template. So the question is, how do I add the favicon code to the admin/backend of the website?

Thank you.

Vegard
  • 41
  • 5

2 Answers2

4

If you go to Craft Settings > General you can add a site icon in there plus a logo for the login page.

Mark
  • 731
  • 3
  • 11
2

If you're on Craft 3.5+, you can use the cpHeadTags config settings to achieve this.

'cpHeadTags' => [
    // Traditional favicon
    ['link', ['rel' => 'icon', 'href' => '/icons/favicon.ico']],
    // Scalable favicon for browsers that support them
    ['link', ['rel' => 'icon', 'type' => 'image/svg+xml', 'sizes' => 'any', 'href' => '/icons/favicon.svg']],
    // Touch icon for mobile devices
    ['link', ['rel' => 'apple-touch-icon', 'sizes' => '180x180', 'href' => '/icons/touch-icon.svg']],
    // Pinned tab icon for Safari
    ['link', ['rel' => 'mask-icon', 'href' => '/icons/mask-icon.svg', 'color' => '#663399']],
],
Brad Bell
  • 67,440
  • 6
  • 73
  • 143