上QQ阅读APP看书,第一时间看更新
Customizing the Windows 8 Start menu tile for pinning sites using a master page
The Windows 8 Start menu allows users to pin sites from Internet Explorer as tiles. SharePoint 2013 provides a simple control to manage how the tile looks and what icon to use. In this recipe, we will customize the tile settings with our customized master page.
How to do it...
Follow these steps to customize the Windows 8 Start menu tile for pinning sites using a master page:
- Open SharePoint Designer.
- Select Open Site. Enter the full URL to the SharePoint site and select Open.
- From the Navigation pane, select Master Pages.
- In the list of files in the Master Pages library, make a copy of
seattle.master
(for our example, we have renamed itSeattle_Windows8Tile.master
). - Check out the new
Seattle_Windows8Tile.master
master page. - Open the
Seattle_Windows8Tile.master
master page. - Locate the
<SharePoint:SPPinnedSiteTile>
element. - Provide a custom image URL and hex color using the following code:
<SharePoint:SPPinnedSiteTile runat="server" TileUrl="/_catalogs/masterpage/resources/SimpleSmiley.png" TileColor="#d17601" />
- Save the master page.
- Check in and publish the master page using the Check In and Publish option.
- Set the master page as the Site Master Page.
- Navigate to the site in Internet Explorer on Windows 8.
- Pin the site to the Windows 8 Start menu to observe the results. The following screenshot shows the option that allows us to pin the page to the Start menu:
How it works...
The SPPinnedSiteTile
server control outputs <meta>
tags to the <head>
element of the SharePoint page when rendered. When Internet Explorer on Windows 8 pins a site, it will look for these <meta>
tags when creating the pin. In this recipe, we provided a custom image and color to be used when adding these tags. This replaces the default SharePoint logo and the blue color.
See also
- The SPPinnedSiteTile class topic on MSDN at http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.sppinnedsitetile.aspx