Feature stapling and custom site templates

When customising a site and then using the “”Save site as Template”” be careful about the state you save it, in relation to custom Features.
 
In my experience I’d created three features that all performed different actions on a particular site. One created a new document library. another one copied some design artefacts into an existing document library and the third one set some default settings we want on all our provisioned sites like Search Centre location etc.

 
The important thing was these three features were stapled at the Web Application level to automatically activate should any site template be provisioned. When it came to saving my site template I thought I would be a good SharePoint developer and deactivate my 3 custom features thinking the stapling would activate when I re-provision the site template….. this was not to be.
 
Remember your custom site features need to be added to your new template through the relevant stapler, if not they wont get activated.
 
Alternatively you can activate the features and save it but then what happens if you update your features!!!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s