Friday, September 21, 2012

Master Pages in SharePoint 2010



SharePoint 2010 supports master pages to support consistent look and feel. SharePoint provides a special document library namely Master Page Gallery for storing master pages. SharePoint foundation has 3 out of box master page  namely:
v4.master
minimal.master
default.master

But still there are some other master pages are present like:
application.master
applicationv4.master
dialog.master
layouts.master
pickerdialog.master
simple.master
simplev4.master
sspadmin.master

You can check all the master page files in this directory also: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS

Amoung all the master pages v4.master is the most popular master page. It has elements like Site Actions menu, the breadcrumb trail, the Ribbon, the Welcome menu, the Site Icon, the TopNav bar, the Quick Launch etc. v4.master is the default master page in SharePoint 2010.

If you open the master page, then you will able to see it contains some standard html element like html, head, body, and form, and includes many server-side controls. But one more major concept it, is contents 34 ContentPlaceHolder  like PlaceHolderPageTitle, PlaceHolderAdditionalPageHead, PlaceHolderMain etc.

Default.master is a master page designed to support a feature known as visual upgrade, which assists companies that are upgrading SharePoint 2007 sites to run within SharePoint 2010 farms. This is beneficial whenever a company is migrating from MOSS 2007 to SharePoint 2010. He does not want his users immediately switch to new SharePoint user interface, in fact users can continue to work with the older SharePoint 2007 user interface during a transition period. After sometime then a site collection administrator can change from default.master to v4.master.

All these master pages are in ghosted, but you can open a site using SharePoint Designer 2010 and modify it. But after that it becomes unghosted and stored in the content database. But we have to remember one thing that these pages can not contain inline code.

Besides using all these out of box master pages, you can also create your custom master page using SharePoint 2010 designer or using Visual Studio 2010.

No comments:

Post a Comment