SPShortcut usage– This is hardcoded, so won’t work with feature deployments.
<SharePoint:SPShortcutIcon runat="server" IconUrl="/Style Library/Waffles/favicon.ico"/>
SPShortcut usage with $SPUrl – This will result in the following error: Unable to cast object of type 'System.String' to type 'System.Uri'.
<SharePoint:SPShortcutIcon runat="server" IconUrl="<% $SPUrl:~sitecollection/Style Library/Acme/favicon.ico %>" />
Solution
<asp:Literal runat="server" Text="<link rel='shortcut icon' href='" /><asp:Literal runat="server" Text="<% $SPUrl:~sitecollection/Style Library/Acme/favicon.ico %>" /><asp:Literal runat="server" Text="' type='image/vnd.microsoft.icon' />" />
Google.com’s favorite icon
SharePoint 2010, Favorites Icons (FavIcons) and SPUrl (SPUrlExpressionBuilder)Credit goes to Joel for this tip. Unfortunately, I could only get to his post via Google cache.http://joelblogs.co.uk/2010/11/09/sharepoint-2010-favorites-icons-favicons-and-spurl-spurlexpressionbuilder/
Great blog very nice information i really like your post. Your article its so amazing. After reading your blog i am very helpful & i really thanks full your. Keep blogging.
ReplyDeleteSo why not point the IconUrl to the something like "/_layouts/1033/styles/favicon.ico"?
ReplyDeleteThis was helpful. Thank you
ReplyDeleteDo you know how to make this string (<% $SPUrl:~sitecollection/Style Library/Acme/favicon.ico %>) work in SP2016 html master page?
ReplyDelete