Feature Stapling in Sharepoint 2010 & 2013

Feature Stapling is a concept using which a specific feature will be stapled to site template

Scenario

I want a custom list to be deleted by default whenever a site is provisioned using the Team Site template. The best way to do this is to create a Feature Stapling.

Steps to create 

1. Create an Empty SharePoint project













2. Create a new Feature1














3. Add feature event receiver







4. Create a Empty element named "FeatureAssociation" [ add new item] and link the Feature1 by using feature id








5. Create a one more feature to stable this feature name Feature 2. Scope of the Feature is "Web Application"










Deploy the solution and go to Central admin and select manage site features and activate our feature1[Name of the feature : Feature Stabler]



Now you will create new site collection by using Teamsite template and go to viewall site contents. you can see that there is no memo list. also u could check with existing site collection.

Thanks hope this will helps you






Comments

Popular posts from this blog

IRM and the Object Model

This content database has a schema version which is not supported in this farm

Activate and Deactivate Feature through PowerShell