Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have this stapled feature to my "Blank" template:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <FeatureSiteTemplateAssociation Id="19e70775-7410-4a0a-a292-8252e622774a" TemplateName="STS#1" />
</Elements>

it's working fine, but i need this feature to be stapled to all templates.

Checking on MSDN documentation, they say you need to use "GLOBAL" instead of "STS#1":

<FeatureSiteTemplateAssociation Id="19e70775-7410-4a0a-a292-8252e622774a" TemplateName="GLOBAL" />

The thing is, when i change it to global, the feature stops working. I'm a little lost, because on sharepoint 2007 it worked perfectly fine, but now on 2010 i can't seem to figure it out.

Anyone got a clue of what i could do to try to fix it.

Thanks.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

First of all, Start with a new feature to ensure everything is clean.

Also, Please note that the configuration for Blank sites is configured(like below) to ignore any features stapled to the Global site definition.The same is true for some other site definitions as well.

<Configuration AllowGlobalFeatureAssociations = "FALSE"...</Configuration>

So you need to explicitly include Blank site definition along with Global like :

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<FeatureSiteTemplateAssociation
Id="[your feature guid]"
TemplateName=" GLOBAL" />
<FeatureSiteTemplateAssociation
Id="[your feature guid]"
TemplateName=" STS#1" />
</Elements>

Also, The activation scope of the feature performing the stapling must be higher than the features being stapled. So, the feature you use to do stapling should be Web Application scoped if the feature it staples is a Site Collection scoped (or lower).

share|improve this answer
    
Thanks for the helpful tips Amit. –  C. Hoffmann Nov 4 '11 at 15:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.