[drupal-devel] [feature] favicon patch for themes

Steven drupal-devel at drupal.org
Sat Apr 23 17:45:30 UTC 2005

Issue status update for http://drupal.org/node/20809

 Project:      Drupal
 Version:      cvs
 Component:    theme system
 Category:     feature requests
 Priority:     normal
 Assigned to:  nysus
 Reported by:  nysus
 Updated by:   Steven
 Status:       patch

There is still a slash missing in bluemarine.

This patch appears to have per-theme favicons, but the setting to
control this is in fact defined by the theme engine, not the template
(through the list of support theme features). I was more thinking of
simply checking for the presence of a favicon.ico in the theme's own
directory. But I'm not sure if we really need this: it does make it
very obvious to people editing a theme that there is an icon file they
can change. On the other hand, few people will use a theme's default
favicon. It's more useful as a customization, and the UI option is good
enough for that.

Some text suggestions: "favorite icon" is not clear. I think the phrase
"shortcut icon" is better (that's the standard name) if we accompany it
with more text. Something like:

"Check this box to use the default shortcut icon or 'favicon'. This
icon is displayed in the address bar and bookmarks in most browsers."

"The path to the icon file you would like to use as your custom
shortcut icon."
(note: i replaced "image file" with "icon file" because for IE,
favicons need to be .ico files)

'Shortcut icon settings'


Previous comments:

April 19, 2005 - 01:42 : nysus

Attachment: http://drupal.org/files/issues/favicon.patch (4.57 KB)

Here is a patch that allows a user to manually set the path to the
"favicon.ico" file.  It makes a single change to the user interface: it
adds a text field to the "Logo image setting" section of the
"themes/settings" page.

This is especially useful for sites sharing a single code base as you
no longer need to create a new theme just so you can have a distinct


April 23, 2005 - 06:28 : Steven

There is a lot of mailing list discussion about this patch.

One more note though: the <link /> tags are missing the trailing slash
for XHTML.


April 23, 2005 - 17:06 : nysus

Attachment: http://drupal.org/files/issues/favicon2.patch (6.01 KB)

Here is a revision to the patch based on the feedback received on the
discussion list.  You can now override the default favicon the same you
way you can override the default site logo.  There is one difference: 
When a logo is uploaded, it is checked to determine whether it is a
valid image file using PHP's getimagesize function.  Since this
function does not work with .ico files, no validation of the uploaded
file is performed.  Advice on how (or if) validation needs to be
done---or any other suggestions and corrections---is welcome.

More information about the drupal-devel mailing list