Article Categories
Archives
Post Categories
  Jump to Information for:
Search:  

This article refers to Microsoft Office SharePoint Server 2007 (MOSS 2007) Beta 2 Tech Refresh.   Details are subject to change in the RTM version.

One way master pages can be stored and used in MOSS 2007 sites is through creation in SharePoint Designer and storage in the Master Page Gallery.   This method will create a master page in the content database.  But what if you need to use one or two master page across multiple site collections?  For ease of updates and maintenance, we don't necessarily want to store a copy of the master page in each site collection. Instead we can create and store master pages on the file system and make them available for new site collections.

PLEASE NOTE, this is for new site collections that have not been created yet, these instructions will not work for site collections that have already been provisioned.  This process will only work for site collections created in SharePoint Central Admin.  Creating a site through the Create Site option in the portal will show your custom master page.

Below is one way to create master pages on the server, but there is a better recommended way of accomplishing this via using a SharePoint Feature. Please reference my other article about this for instructions on how to create this functionality as a Feature:  Create a Feature: Master Pages for Site Collections

How to Add Master Pages to the Web Server for Use with Newly Provisioned Site Collections

  1. Navigate to the master page storage location on your web server:
    Local Drive:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\PublishingLayouts\MasterPages
  2.  Copy one of the existing master pages, paste the copy in the directory, and rename the copy to your unique name.  Alternately paste in your custom master page, or create a new blank file with the extension of .master.
    Location of the master pages on the web server

    Tip! To just get a master page going, copy the sample code from this article and paste it in your custom master page file.  That will get you up and running for this article and give you a good starting point for your customizations once the master page has been applied to your site. 

  3. Navigate to the Publishing Layouts XML file in the PublishingLayouts directory:
    Local Drive:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\PublishingLayouts
  4.  Locate and make a backup copy of ProvisionedFiles.xml.  Keep this backup in a safe location.
  5. Open ProvisionedFiles.xml in Notepad or a similar editing application.
  6.  Locate the OSGMasterPages Module tag:
  7. Locate a FILE tag block within the Module tags, copy and paste at the end of the File tags and before the closing Module tag.
    Copy and paste the FILE tag block
  8. Update the properties to reflect the new master page details:
    1. Change the URL to your custom master page.
      <File Url="Sample.master" Type="GhostableInLibrary">
    2. Change the Preview Images to a custom image.
      <Property Name="PublishingPreviewImage" Value="~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/Sample.png, ~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/Sample.png" />
      Add the custom image to the following directory:
      Local Drive:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\PublishingLayouts\en-us
    3. Update the Description.  Enter a description for your master page.
      <Property Name="MasterPageDescription" Value="Here is my sample description" />
  9. In the next Module, PublishingLayoutsPreviewImages, create an entry for the preview image by copying and pasting and existing FILE tag and updating the properties.
    <File Url="Sample.png" Name="Preview Images/Sample.png" Type="GhostableInLibrary">
    </File>
  10.  Navigate to SharePoint 3.0 Central Administration on the web server and create a new Site Collection using the Publishing Portal or Collaboration Portal site template.
  11. Open your new site and change the master page the site uses:
    1. Go to Site Actions - Site Settings - Modify All Site Settings - Master page (under the Look and Feel submenu)
    2. Depending on your requirements, in either or both the Site Master Page setting and the System Master Page setting, select your drop down box and choose your custom master page. 
      Master page selection drop down
    3. Select OK.
  12. Reset IIS on the web server (Command Prompt - IISRESET).

In my next article I will cover what to do next with your custom master page and how do you start customizing it.

posted on Wednesday, October 18, 2006 6:30 PM
Comments
  • # re: How to Create and Store Master Pages on the Server for Use with Site Collections
    EROL MVP SPS
    Posted @ 10/18/2006 8:51 PM
    Thanks EROL
  • # re: How to Create and Store Master Pages on the Server for Use with Site Collections
    Kanwal
    Posted @ 10/19/2006 11:04 AM
    You are now part of the BUZZ, Sharepoint BUZZ


    Visit http://www.sharepointbuzz.com
  • # Master Pages Feature
    SharePoint, SharePoint and stuff
    Posted @ 10/20/2006 12:37 PM
    Heather Solomon hat sich in zwei Artikeln mit der Erstellung, Speicherung und Verteilung über Feature
  • # SharePoint resources
    Stefan Goßner
    Posted @ 2/21/2007 6:47 AM
    WSS 2.0 Best Practices: Using Disposable Windows SharePoint Services Objects WSS 2.0 SDK Whitepaper -
  • # re: How to Create and Store Master Pages on the Server for Use with Site Collections
    Christopher Bermingham
    Posted @ 3/5/2007 3:05 PM
    Is there a way other than the gui to specify that a page should use the new master page through sharepoint designer or via editing a file on the file system(i.e. on form.aspx or viewpage.aspx)?
  •  re: How to Create and Store Master Pages on the Server for Use with Site Collections
    Craig Campbell
    Posted @ 3/6/2007 3:16 PM
    Hi Heather,
    Is there anyway possible to force a master page farm wide? This articles helps, as you said, only for newly created sites. In our case, we have a few existing portals in which I'd like to apply a custom master page to. However, I only want to work with one copy of the master page. I realize I can add the MP to the MP Gallery and apply to each site, but I'd rather only work with one version.

    Cheers!
  •  re: How to Create and Store Master Pages on the Server for Use with Site Collections
    Craig
    Posted @ 3/7/2007 4:30 PM
    I'm getting File Not Found errors after selecting the custom master page. Any ideas?
  •  re: How to Create and Store Master Pages on the Server for Use with Site Collections
    c_marius
    Posted @ 5/4/2007 5:28 AM
    I do agree your scenario works on MOSS, but unfortunatelly i was not able to find the ProvisionedFiles.xml file on my WSS installation.
  •  re: How to Create and Store Master Pages on the Server for Use with Site Collections
    Paisleygo
    Posted @ 6/26/2007 6:36 PM
    re: the satement above:
    This process will only work for site collections created in SharePoint Central Admin. Creating a site through the Create Site option in the portal will show your custom master page.

    When I read this I thought it was a typo - sounded like you meant to say:Creating a site through the Create Site option in the portal will NOT show your custom master page.

    so --I have tried this both ways and this is what I found:

    If I create the site from central admin it shows up for either drop down
    BUT
    If I create the site from the "create site" link on my preprovisioned site and go in to assign the master page - the masterpages that I added to the ProvisionedFiles.xml file on the file system - are NOT in the drop down for the sites master page. HOWEVER - they do show up under the System Masterpages area (guess that makes sense)

    So - the nut of it is...
    no old sites - but all new ones (from central admin - or not) will be able to see it.

    would you say that is correct?






  •  re: How to Create and Store Master Pages on the Server for Use with Site Collections
    Tom
    Posted @ 8/30/2007 2:04 AM
    Heather,

    Have you managed to find a solution so that the default master page when a site is created is your customised version i.e. we have enabled self service site creation and we want all sites created by the business to automatically use the custom master page and not the let the user choose. We have tried removing all master pages from the template gallery but SharePoint looks at the 12 hive and if we change the default.master (AFTER backing up) in the 12 hive templates, this then applies the revised Master page to the Central Admin site which we don't want

    Thanks

    Tom
  • # re: How to Create and Store Master Pages on the Server for Use with Site Collections
    Hernan
    Posted @ 9/19/2007 4:30 PM
    In my case I could only get it working by creating the site through Sharepoint Central Administration.

    PD: Don't forget that "Office SharePoint Server Publishing Infrastructure" service must be activated (It is under Site Collection Features) otherwise the new masterpage would not be available in the Combo Box. :P. I spent some hours with that
  •  re: How to Create and Store Master Pages on the Server for Use with Site Collections
    pooja
    Posted @ 11/20/2007 4:43 AM
    It did not work for me. I followed the steps which you have given above and created a site collection using central administration. But the new master page is not displayed in the combo box
  •  re: How to Create and Store Master Pages on the Server for Use with Site Collections
    Sheethal
    Posted @ 4/10/2008 10:35 AM
    HI
    I am trying to follow the steps mentioned but i am not able to see
    the link for MOdify All Site Settings
    I find Go to Site Actions- Site Setting and after that i am not able to see the link for Modify All Site Settings.

    Please help me...
Title  
Name  
Email (never displayed)
Url
Comments   
ALL COMMENTS ARE MODERATED! Sorry for the inconvenience, but it is how I keep all of the spam and advertisers out. I moderate comments about once a week and your comment will appear soon. Thanks for posting!
Please add 5 and 3 and type the answer here:

Copyright © 2005-2008. Heather Solomon.
Site design by Heather Solomon

Blog Stats:
Posts - 378
Stories - 38
Comments - 1581
Trackbacks - 182