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" />

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.



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/">
Id="[your feature guid]"
TemplateName=" GLOBAL" />
Id="[your feature guid]"
TemplateName=" STS#1" />

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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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