shortcut icon syntax incorrect/incomplete
page.shortcutIcon adds this to the page:
<link rel="SHORTCUT ICON" href="(whatever path was set in the template)" />
there's twi relative links required to catch all the browsers/platforms that might be used, for some really dumb reason ... even though Micro$queak's web page (http://www.microsoft.com/technet/prodtechnol/ie/support/tipsauth.mspx) states to use the above syntax, MSIE seems to not always like it (whilst Firefox does).
the fix is to edit tslib/class.tslib_pagegen.php (syntax confirmed from http://www.winterdrache.de/freeware/png2ico/favicon.html).
this will make MSIE find the favicon and use it in bookmarks.
find (around line 448)
<link rel="SHORTCUT ICON" href="'.htmlspecialchars($ss).'" />';
<link rel="icon" href="'.htmlspecialchars($ss).'" type="image/x-icon" /><br />
<link rel="shortcut icon" href="'.htmlspecialchars($ss).'" type="image/x-icon" />';
(issue imported from #M1537)
Updated by Matthew over 15 years ago
I am looking at another very related shortcut icon issue.
Search engines are indexing links to this shortcut icon location as a relative link from the path. So an example. Using realurl and a 'path' of www.site.com/page1/fileadmin/favicon.ico This is clearly wrong and the fix is to define the shortcuticon as forward slash fileadmin or /fileadmin/shortcuticon.ico forcing the path to start from the domain root.
However TYPO3 just ignores this and fails to put any path at all into the html code.
base href is a workaround but I think TYPO3 should allow the forward slash.
Updated by Ernesto Baschny about 14 years ago
Aparently IE ignores the base-href for the shortcut icon. So if you have:
<base href="http://www.domain.com/" />
<link rel="SHORTCUT ICON" href="fileadmin/favicon.ico" />
And you are in the URL:
IE will try to load the shortcut from:
So either we should be able to enter a full URL here (http:/...) or a fixed path from website root ("/..."), both of which is not possible yet in shortcutIcon.
Updated by Michael Stucki over 13 years ago
Attached is a new patch which uses finfo_file() instead of the deprecated "mime_content_type" function.
Additionally, I have chosen to prefix the icon path with the TYPO3_SITE_URL which solves the fact that MSIE ignores the base URL for the shortcut icon.