Master Pages In Sharepoint 2007 (beta 2)

I really like master pages in asp.net 2.0 and really liked the idea of them being used / available to the end user in Sharepoint 2007. From what I initially saw, I assumed that site collections would have a master page gallery (which could be used by all subsites). I was also hoping for propergation of masterpages through site hierachies (which had not had an alternative masterpage applied). This does seem to be the case – but not everywhere.
The way in which master pages are applied to sites supporting alternate master pages is as follows:

  1. Make a copy of the sites default.master (from the masterpage gallery). You can obviously create a new master page from scratch, but there is a danger that you may forget to include important Sharepoint controls).
  2. Edit you copy master page in visual studio / frontpage / notepad etc. Be careful not to when stripping out references to Sharepoint controls (normally youll probably want to leave most of these in)
  3. Upload your new masterpage to the masterpage gallery (off of site settings), be sure to ensure that this new masterpage is approved.
  4. Go to the site.settings page of the relevant site. Select the Site Master Page Settings link under the look and feel section.
  5. Apply the new master page to the site and refresh your browser. The master page will be applied.

Now, this is what really puzzles me – all subsites seem to have their own masterpage gallery, but there is not an option on the relevant site settings page for Site Master Page Settings. This makes me ask why is there a gallery if the only think that is ever used is default.master. Note that this could just be something that is resolved in Sharepoint 2007 RTM, or it may simply be a way of letting you alter the hardcoded master page (if so this seems like a bit of a cludge).

The only mechanism for changing master pages on sites that do not allow alternate master pages, appears to be by simply editing the default.master file. This can be done either by accessing it through the masterpage gallery or by navigating to it in Sharepoint Designer 2007. I believe that in such sites, the reference to the masterpage is hardcoded to default.master in the page definitions (specified by MasterPageFile="~masterurl/default.master" in the page directive). Note: the article http://channel9.msdn.com/showpost.aspx?postid=197664 tells you to directly edit default.master.

The table below summarise which out of the box site templates support master pages, and to what extent…

Group
Template
Has Master Page Gallery
Can Set Master Page
Inherits From Parent Site Master Page

?
Root Site
Y
Y
N/A

Collaborations
Team Site
Y
N
N/A

?
Blank Site
Y
N
N/A

?
Document Workspace
Y
N
N/A

?
Wiki Site
Y
N
N/A

?
Blog
Y
N
N/A

?
Records Repository
Y
N
N/A

?
News Home Template
Y
Y
Y

?
Publishing and Team Collaboration Site
Y
Y
Y

?
Publishing Site
Y
Y
Y

Meetings
Basic meeting workspace
Y
N
N/A

?
Blank meeting workspace
Y
N
N/A

?
Decision meeting workspace
Y
N
N/A

?
Social meeting workspace
Y
N
N/A

?
Multipage meeting workspace
Y
N
N/A

Enterprise
Document Center
Y
N
N/A

?
Personalisation Site
Y
Y
N

?
Site Directory Area Template
Y
Y
Y

?
Report Center Site
Y
Y
Y

?
Search Center Site
Y
Y
Y

Note that on sites that only have a default.master page, all settings pages use the application.master page – this is global and unfortunately cannot be overridden.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>