Comments

dave reid’s picture

etroid’s picture

Status: Active » Needs review
StatusFileSize
new1.37 KB

I do believe that, while Responsive favicons is a great module, Metatag module itself should include a "shortcut icon" tag as this is part of drupal core. This patch adds support for overriding the favicon in the advanced section of the metatag configuration.

By default it will use the path defined in the appearance/theme configuration.

Status: Needs review » Needs work

The last submitted patch, 2: metatag-shortcut-icon-1304038-2.patch, failed testing.

etroid’s picture

StatusFileSize
new1.1 KB

Uploaded the wrong patch in the previous post by mistake...

etroid’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 4: metatag-shortcut-icon-1304038-3.patch, failed testing.

etroid’s picture

Status: Needs work » Needs review
StatusFileSize
new1.81 KB

Updated the metatag.test file to include the 'shortcut icon'.

damienmckenna’s picture

+++ b/metatag.metatag.inc
@@ -349,5 +350,16 @@ function metatag_metatag_info() {
+      '#attributes' => array('type' => theme_get_setting('favicon_mimetype')),

If the site builder customizes the shortcut icon, isn't it possible that the mimetype would change from what is defined in the theme?

etroid’s picture

StatusFileSize
new3.86 KB

#8 You are right about that (and I should probably not have been coding on a Friday night). I propose the following solution:

A new controller "DrupalShortcutIconMetaTag" with an extra form element "type" which allows the user to enter the mime type of the shortcut icon. It will still use "metatag_link_rel" theme function to render the element, but with an extra attribute "type".

Alternatively we could just determine the mime type of the file by calling the "file_get_mimetype" function. However, I prefer the end user to make this decision as there is some discussion regarding which mime type to use for the .ico files (i.e. IANA standard image/vnd.microsoft.icon or image/x-icon)

damienmckenna’s picture

Status: Needs review » Needs work

The nested trinary operators need to be redone, they gets ugly really fast.

damienmckenna’s picture

Title: Add support for overriding the 'shortcut icon' link » Add new meta tags: shortcut icon / favicon

Standardized the issue title.

damienmckenna’s picture

Status: Needs work » Postponed

I think this should be added to #2085747: Add new meta tags: touch icons once it is finished.

jcnventura’s picture

Status: Postponed » Needs work

Does it still?

damienmckenna’s picture

This needs to be updated to use the new metatag_favicons module.

jcnventura’s picture

One question, about all these favicons... Can't we generate all sizes automatically?

damienmckenna’s picture

Theoretically, but Metatag would need a file uploader and then provide a bunch of image styles, one for each size.

etroid’s picture

StatusFileSize
new3.49 KB

I've refactored the patch to make use of the new metatag_favicons sub module.

etroid’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 17: metatag-shortcut-icon-2384673-17.patch, failed testing.

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new3.77 KB

I tidied it up a little bit and extended the existing theme function rather than adding another one; I'm not entirely convinced it shouldn't be a separate theme function yet, I'll ponder on it.

damienmckenna’s picture

StatusFileSize
new4.05 KB

I changed it back to having a custom theme function, instead of overloading the existing favicons theme function.

damienmckenna’s picture

StatusFileSize
new3.97 KB

Tested, and this version will actually pull the default value from the theme settings.

damienmckenna’s picture

Status: Needs review » Fixed

Committed.

  • DamienMcKenna committed 28da993 on 7.x-1.x authored by etroid
    Issue #2384673 by etroid, DamienMcKenna: Added the shortcut icon meta...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

tr-drupal’s picture

Does this mean, that once an update with this fix comes out, there won't be any need anymore to use the favicon module (https://www.drupal.org/project/favicon)?

Edit: I've probably misinterpreted it. For me it was about avoiding all 404 errors when some browsers try to access the favicon at /favicon.ico and ignore the "shortcut icon" tag, which is already correctly set based on the theme settings.