Monday, March 25, 2013

Adding feature stapling to custom site tempalte.


Adding feature stapling to any custom site tempalte.

1. Add a new feature with feature stapling xml
2. Add following xml to element.xml file for that feature.

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <FeatureSiteTemplateAssociation
  Id="2B78C8DE-4C07-4a18-A6A6-E9FE1AB7EE30"
  TemplateName="TestSiteTemplate#0"/>
</Elements>



Notes-
1. Please make sure that the newly added feature is part of the custom web template.

2. You can find out template name and ID (Ex. TestSiteTemplate#0 )in the xmls given at following path.
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\1033\XML