سؤال

I am working with Visual Studio 2008 with the WSPBuilder add-in, and WSS 3.0. When I create a Web Part feature and deploy it to my SharePoint site, it is available to every site collection in the web application. Is there a way to only deploy it to a single site collection?

هل كانت مفيدة؟

المحلول

This isn't possible. If you only want to activate in one site collection, set it as hidden, and activate via stsadm.

نصائح أخرى

One of a former project I worked on, I use a custom site template to hide features to other site collections.

The idea is to follow these steps :

  • create a custom site template specific to your application. I often use to starts from the blank site definition to start from scratch (but it can depends on your requirements)
  • create all features related to your application, and mark all of them "hidden"
  • in the onet.xml file, auto-activate your features.

When the user create an instance of your site, your features will be activated automatically. Other site collections won't show at all these features (but the feature will still be activable from command line).

If you look at Microsoft Publishing site template, you will see that a lot of features are hidden, but activated via the site definition.

Some drawbacks however, with this method :

  • the site must have been created using the custom template
  • it requires a deep understanding of the site template creation (not the easiest par of SharePoint)
  • when you use custom site templates, you have to manually found all feature stappled to the OOB templates, and apply them in the onet.xml
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى sharepoint.stackexchange
scroll top