Tell me more ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

In 2007 as well as it seems in 2010, feature stapling doesn't seem to be applied to templates. I am feeling short on time and was just wondering if anyone has seen some code out there that would work around this issue?

If I find the time I would probably implement it this way:

Create a feature that is webapp scoped that would then activate a site scoped feature and be stapled to all site definitions (global, STS#1). Next, create the feature that is a site scoped that would add an event receiver to the webprovisioned event at the site collection root. That event receiver would go through all web application and site scoped features currently active, and any of those that were setup to be stapled, it would check the basetemplate and configuration, and if it matched it would activate the appropriate feature on the web being created.

Thoughts? Thanks!

share|improve this question
Could you clarify your scenario a bit. Is the web-app scoped feature a stapling feature (i.e. it only includes featuresitetemplateassocation entries)? It sort of sounds like you are trying to re-implement what the stapling capability does with your own event receiver, but I'm guessing that's not actually what your doing and it's just an textual interpretation issue on my part? – Samuel Yates Jul 12 '10 at 22:14
Right, since feature stapling doesn't work with templates, I'm trying to reimplement the stapling capability with my own event receiver so all of my cases are taken care of. I want to know that when I activate a feature, that all sites, no matter how they are created will get this feature activated because right now there is a gap. For example, when a user creates a site template, and then I roll out a new feature that is needed on all sites, when a site is created from that template, the new feature doesn't get activated. Does that make sense? Thanks! – Steve Lineberry Jul 13 '10 at 0:30

closed as not a real question by Alex Angas Jun 4 '11 at 6:03

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.