Master Pages in MOSS 2007

Master Pages in MOSS 2007

'MasterPages' feature in sharepoint 2007 makes the entire customization job easy.In 2003 we used to face lot of issues to get the same look and feel and the standard behaviour for overall site. In 2007, customizing the look and feel for the entire site can be done in a simple way by using 'MasterPage' feature.

'Master Page' concept has come from .Net framework 2.0, Its been used in Asp.Net 2.0. Basically a 'MasterPage' is a Asp.Net file with an extension '.master'. 'Master Page' will have a predefined layouts and that can be inherited throughout the site.So to modify the look and feel of the entier site, you can modify the master page and that will refelect the whole site. In SPS 2007 pages will be rendered with the combination of 'MasterPages', 'PageLayouts' and 'The content Type'.

Page Layouts are templates with the definetion of the content structure to dsiplay, usually page layouts are associated with the content types(Click here for Content Types).

Creating a custom Master Page

Go to Templates->Global, copy and paste the default.master, name the new master page as 'MySpace.Master'

Now open the 'MySpace.Master' in your favouite Asp.Net ide and do the required changes.


Note: I have changed the backgound color, alignment and width of the default master page.

Adding the Custom Master Page in Master Page Gallery

Once the new master page is created we need to add it in the master page gallery to apply it for all the pages.

Go to 'SiteActions' -> 'SiteSettings' -> 'Galleries' -> 'Master Pages'


In gallaries page click upload to Upload the custom master page




Once the mastre page is uploaded you should see it in gallaries list...

Applying the Custom Master Page for Sites

To apply the custom master page, we need activate 'Office SharePoint Server Publishing Infrastructure' feature so that we will get the 'Master Pages' link under 'Look and Feel' section of site settings page.This 'Master Page' will let administrator to change the master pages.

To activate 'Office SharePoint Server Publishing Infrastructure' , go to 'SiteActions -> Site Settings' -> and click 'Site Collection features' link

In site collection feature page activate the 'Office SharePoint Server Publishing Infrastructure'

once its activated you must see 'Master Pages' link under 'Look and Feel' Section

Now clikc 'Master Pages' link to apply the new master page for the entier site, In 'site master page settings' page select the custom master pages for both the 'System' and 'Site' master pages(as given below) and you should be able to see the modifed changes throught the site.

There are two types of master pages used in sharepoint 2007.They are 'Site Master Page' and 'System Master Page'

Site Master Pages are used for all publishing pages

System Master Pages are used for forms and views within the site

Finally the application with the custom master page will look like...