
206
❘
CHAPTER 8 MASTER PAGES
This would point to the master page that is set as the System Master Page. You will learn
more about changing the Site and System Master Pages later in the chapter.
The following static tokens are available for SharePoint master pages:
~site
➤
and ~sitecollection — These two static tokens may be manually applied
to pages to point to specifi c master pages using a relative reference to either the site
or site collection root. Without using one of these static tokens, pages in SharePoint
would be tied to their original location, and moving them would cause the master
page to stop working. For example, if you used the following reference, your page
would look for
Waffles.master at the root of the site collection no matter where
the page was located in the site hierarchy:
<%@ Page MasterPageFile=”~ sitecollection/Waffles.master”%>
SharePoint Master Page Structure
Earlier you saw a sample ASP.NET master page, so now you can compare it with a sample SharePoint
master page. Microsoft created a very simple SharePoint 2010 master page that can be found at
http://code.msdn.microsoft.com/odcSP14StarterMaster. It contains too many lines of code to
list here, but if you download it you can review it alongside the following discussion of its structure.
The fi rst thing you may notice looking at the SharePoint master page is that it is generally much
larger than the simple ...