开发者

How to create a feature with feature stapplingin SharePoint?

开发者 https://www.devze.com 2023-02-07 09:18 出处:网络
I am new to Sh开发者_JAVA技巧arePoint. I have done basic programs on creating a feature. Got stuck with creating a feature with feature stappling. Can anyone provide me code| logic for this Program?

I am new to Sh开发者_JAVA技巧arePoint. I have done basic programs on creating a feature. Got stuck with creating a feature with feature stappling. Can anyone provide me code| logic for this Program? Thanking you.


1) Open a new sharepoint visual studio 2010 project

2) Make your feature as normal

3) Find the site definition id you want to staple your feature to

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\1033\XML\webtemp*.xml

4) Create a new module, call it "Stapling" or something

5) Insert this into the module file, replacing the site definition template name and feature guid:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <FeatureSiteTemplateAssociation Id="FEATUREGUID" TemplateName="YOURSITETEMPLATE#0" />
</Elements>

6) A new feature should have been created for "Stapling", but if it has not, create it and the Stapling module to it

7) Set the deployment scope to "Farm"

8) You should have 2 features in your project now

9) Package and deploy

0

精彩评论

暂无评论...
验证码 换一张
取 消