Welcome to the Stramit SharePoint 2007 Master Picker

(Release 1.1 for RTM + source code.)
http://www.codeplex.com/SPMasterPicker/Release/ProjectReleases.aspx?ReleaseId=2127

This project come from a little sample for SharePoint Technologies 2007.

For me, one of the big advantages in the V3 version of SharePoint is certainly the using of Master Page.

As you know, WSS use it for organise its content and MOSS for content and layout
>>> In fact, Master page are link with all need of SharePoint Customization

Never forget that every SharePoint site can use a different Master page : the default.master is not the only one

BUT (there's always a but), you will find nothing in WSS for select a different Master page !
>>> You always need to do it by SharePoint Designer or directly in its site definition

So, people start always with modify the default.master ...

However, after working with a sample from Microsoft and some MSDN code, i discover that the master page of a SharePoint site is just a property
http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.spweb.masterurl.aspx

Example :
webRef.MasterUrl = webPathMasterUrl ;
webRef.Update();

So, after some personnal brainstorming, i started to modify the Microsoft sample to create a real "Master Page Picker"
>>> i decide to add every option i thought interesting when i want to apply a master page.
Example : using one Master Page in the root web gallery and apply it to the ALL Web Collection

Why not using something like this kind of master?

This project will hold 2 version of the MP Picker :
  • a Feature
  • a WebPart

The Feature version
Sample from MS extended by myself
This feature allow you to select quickly a master page for a WSS v3 site in the site settings zone

MPSettings.jpg

MPselect.jpg

Here some feature of this feature :)
  • Show current Master Page (MP) url
  • Filter only MP files in the listbox
  • Could switch and select from the current MP gallery or the root web gallery
  • Auto select the actual MP file in the listbox (top or local)
  • apply a master page to the current site
  • apply a master page to the current site and its sub site !
  • reset all the current site and its sub site with the default.master page

I include also 2 new MP files in the feature to show vertical/horizontal navigation
>>> this file are directly insert in the rootweb gallery

Install
=======

Everything is in the install .bat
>>> just modify 2 things :

1) The path of the fisrt line (path of the dezip file of the feature)
cd C:\Transfert\Developpement\MasterPageSwitcherExt

2) Url path of your SharePoint URL site in the last line
stsadm -o activatefeature -filename SelectMasterPages\feature.xml -url http://MOSS:141/


The WebPart version

This is a light WebPart version of the Master Picker Feature. But i made this version with one objective : a kind of local Master Remote Controler

MPpickerWP.jpg
  • Show current Master Page (MP) url
  • Filter only MP files in the listbox
  • Could switch and select from the current MP gallery or the root web gallery
  • Auto select the actual MP file in the listbox (top or local)
  • apply a master page to the current site
  • apply the next or the previous master page of the list like a MP remote

PS : beware of the Minimal.master, it a very limited one and can crash your site

Hope you will enjoy this little project and find some idea to extend it

Just wait for your feedback !

Renaud Comte MVP
US blog : http://blog.spsclerics.com/
FR blog : http://blogs.developpeur.org/themit/

Last edited Mar 3, 2007 at 3:56 PM by rcomte, version 17