DotNetAdil

May 16, 2012

SharePoint MasterPage – different masterpage for different site pages

  1. When a new site is created, SharePoint (Foundation) will provide 3 masterpages that will have its own purpose.
  2. You can see this masterpages by going to SiteAction -> Edit in SharePoint Designer

  3. Your site now will be open in SharePoint Designer and by clicking on the Master Pages link in the Side Objects pane, you’ll see the three OOTB master pages provided by SharePoint

  4. OOTB master pages.
    1. default.master – is for backward compatibility, SharePoint 2007
    2. mimimal.master – is for search page
    3. v4.master – is for SharePoint 2010
  5. When you right click on the v4.master, you’ll find that both Set as Default Master Page
    and Set as Custom Master Page is greyed out. Because v4.master is set as those two (Default and Custom) by default.

  6. This gives you a chance to create your own master page and set it to either Default or Custom so that you can swap it easily.
  7. For example I added my own master page called SharePointWaves.master and set it as the Custom Master Page. You can upload a master page by going to Site Action -> Site Settings and click on Master Page under the Galleries header.

  8. From the image below you can see that I’ve set v4.master as the default and SharePointWaves (mine) as the Custom. The option (default or custom) will be greyed out once you set it.

  9. To change the masterpage for a Site Pages, just open the target site pages and find the MasterPageFile property and change it to default.master or custom.master.

  10. The Home.aspx with custom.master

  11. And here, Home.aspx with the default.master

  12. The whole point of this article, is to show that how simple it is to have two masterpage that are interchangeable just by setting the MasterPageFile property to either default.master or custom.master via SharePoint Designer

Create a free website or blog at WordPress.com.