MasterPage Stapling Feature

SharePoint 2007 has been around for a while and one of the things I recently stumbled
up again made me creating my first CodePlex project. Whenever you create a custom
masterpage, and use that on your site collection each created subsite that is not
of the type publishing will use the default SharePoint style, and so ‘breaking’ your
layout.

Now I know there are several solutions on the web that you can buy, or that you can
simply ‘apply’ your custom masterpage manually. But I used some time making a feature
that can be used to apply the masterpage used in the parent site on activation, and
reset it to it’s default on deactivation. And in order to make it even easier I made
another feature that staples the other feature to each site definition, so whenever
you create a site the feature that applies the masterpage is automatically attached
and activated.

The CodePlex project can be found on http://masterpagestapler.codeplex.com/ and
contains both the 2 -wsp’s (in case you don’t care about the source, and just want
to fix it), and it contains the source.

Leave a Reply