The shortcut icon, or favicon, is a 16 px by 16 px image that most browsers will display as part of the title bar when viewing a web page as well as when bookmarking the web part. In this recipe, we will change the shortcut icon with our customized master page.
Follow these steps to customize the shortcut icon using the master page:
seattle.master
(for our example, we have renamed it Seattle_ShortcutIcon.master
).Seattle_ShortcutIcon.master
master page.Seattle_ShortcutIcon.master
master page.<SharePoint:SPShortcutIcon>
element.<SharePoint:SPShortcutIcon runat="server" IconUrl="/_catalogs/masterpage/resources/favicon.png" />v
The SPShortCutIcon
server control outputs a <link>
tag for the shortcut icon (or favicon) to the <head>
element of the SharePoint page when rendered. When most web browsers render the page, they will use this image in the title bar or bookmark for the page. In this recipe, we provided a custom image that replaces the default SharePoint logo when adding the tag.
Apple devices, such as iPhones and iPads, look for specific images when determining what to display as the icon for a site when pinning it to the home screen. We can add <link>
tags to instruct these devices to use images we have provided. For instance, let's look at the following link tags:
<!-- Standard iPhone --> <link rel="apple-touch-icon" sizes="57x57" href="apple-touch-icon-57.png" /> <!-- Retina iPhone --> <link rel="apple-touch-icon" sizes="114x114" href="t apple-touch-icon-114.png" /> <!-- Standard iPad --> <link rel="apple-touch-icon" sizes="72x72" href=" apple-touch-icon-72.png" /> <!-- Retina iPad --> <link rel="apple-touch-icon" sizes="144x144" href=" apple-touch-icon-144.png" />
3.141.19.185