The first and most important master page is the System master page. It is referred to as such on the UI, but is called the "Default" master page in SharePoint Designer. This master page is used by all non-publishing pages on a site (which, of course, is literally everything if you don't have Publishing features turned on). Regardless of the actual name of the .master file in the Master Page Gallery, you can reference this master page in an ASP.NET page by using "~masterurl/default.master" as the MasterPageFile attribute value in the Page directive.
The second master page, used only by publishing pages, is the Site master page. This is identified as the "Custom" master page by SharePoint Designer. It can be referenced using a shortcut value of "~masterurl/custom.master" in the Page directive.
Here's a handy chart!
UI Name | SPD Name | Used By | Shortcut Value | SPWeb Property |
System Master Page | Default Master Page | All pages except Publishing pages | ~masterurl/default.master | .MasterUrl |
Site Master Page | Custom Master Page | Publishing Pages (inherit from PublishingLayoutPage class) | ~masterurl/custom.master | .CustomMasterUrl |
No comments:
Post a Comment