Question

Is it possible to turn off a feature using featuring stapling? How could you turn a feature off for all new sites that are created by default?

Edit

I have a feature staple to turn on publishing on each site. I want to turn off Wiki Page Home Page so that when you go to add a page the wiki page is not the default.

Was it helpful?

Solution

Don't think it is possible (anyone, fell free to correct me). But you can always do the opposite - staple a custom feature and deactivate the target features from the custom feature event receiver.

OTHER TIPS

It depends. Normally you can just set the ActivateOnDefault=False in the feauture. Otherwise you can add an EventReceiver containing code to "turn off" the feature(s) you want.

You do this by opening your solution in Visual Studio > right click on the solutions top-level > Add new item > Event Receiver <-- By this stage a dialog will open in which you choose on what occation this EventReceiver should trigger and what phase of an event you want to manipulate, in this case the "Web Provisioned" phase. It then generates an EventReceiver in which a WebProvisioning method will be available to modify for your needs.

I hope this helps.

You can remove the feature reference in onet.xml

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top