Allow theme developers to add the default favicon filename to the theme's .info.yml

Created on 6 March 2019, almost 6 years ago
Updated 9 June 2023, over 1 year ago

Problem/Motivation

Currently only a logo can be set via the theme's .info.yml.
It would be very nice if the same feature for a logo would be available for the favicon.

Steps to reproduce

core/includes/theme.inc

          if (file_exists($favicon = $theme_object->getPath() . '/favicon.ico')) {
            $cache[$theme]->set('favicon.url', file_url_transform_relative(file_create_url($favicon)));
          }
          else {
            $cache[$theme]->set('favicon.url', file_url_transform_relative(file_create_url('core/misc/favicon.ico')));
          }
  • png favicon is supported by all browsers
  • pg and gif is also supported, but those are not the best formats for favicon
  • svg is not supported by all browsers, yet
  • it is easier to create a (nice) png file than ico
  • it is already possible to use png favicon in Drupal, but only ico is supported as a favicon file in the theme folder

Proposed resolution

  1. search for favicon.png
  2. search for favicon.ico
  3. use Drupal default

Remaining tasks

User interface changes

-

API changes

-

Data model changes

-

Release notes snippet

Feature request
Status

Needs work

Version

11.0 🔥

Component
Theme 

Last updated about 1 hour ago

Created by

🇭🇺Hungary pasqualle 🇭🇺 Budapest

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024