5.4. SharePoint Master Pages — A Deep Dive

Master Pages are used throughout SharePoint to provide common navigation and apply a consistent look and feel. As stated earlier, a Master Page is a combination of common elements and replaceable content regions.

Content regions are represented by <asp:ContentPlaceHolder> tags. These tags are assigned various properties and default content. The default content in a region can be replaced on the individual pages based on this Master. You can use the Region Types feature discussed in chapter 4 to restrict the kinds of changes made to content regions in SharePoint Designer.

In addition to the content region placeholders, a SharePoint Master Page contains tags that aren't replaced by content, but rather control page layout, set fonts, or invoke or render a particular piece of SharePoint functionality.

5.4.1. The Default Style Sheets

The default.master Master Page provided in SharePoint is over 400 lines long. Most of these lines are typical HTML tags defining the placement and style of various elements, defining the standard SharePoint look and feel. All of the styles used are defined in a style sheet called core.css. The following lines of code load the core.css style sheet, and any Theme that may be applied to the site.

<SharePoint:CssLink runat="server"/>
<SharePoint:Theme runat="server"/>

In Figure 5-9, these two lines have been removed, and default.master is saved as nostyle.master. The remainder of the Master Page is unchanged. Nostyle.master ...

Get Professional Microsoft® SharePoint® Designer 2007 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.