0

I have created a new feature in visual studio and scoped it to web. I have deployed this to a site collection. When i look at the site collections features it appears there.

Why is this?

I thought this would only appear in subsites of that site collection (because the scope is set to web).

  • what does the feature contains? – Falak Mahmood Nov 22 '12 at 19:24
4

Take a read of this first off: Previous stack exchange answer

Web targets the site, site targets the site collection etc etc.

So web is only available on the site you point it at, be it the site collection or a sub-site and only in that location. A site collection is just a special sort of site.

  • Web: At the target site/site collection only
  • Site: At the entire site collection and sub-sites
  • WebApplication: At all Site Collections and sub-sites in target WebApp
  • Farm: At all WebApplications, Site Collections and sub-sites

So if you want to target just sub-sites you need to create a deployment script that just loops through each sub-site and deploys at web level.

  • +1, I think I have nailed it pretty much in my earlier post. Thanks for referring it ;) – Falak Mahmood Nov 22 '12 at 22:15
2

I think you are misundestanding the difference between the Site collection and the root web.

The Site collection is the technical "tree" of SPWebs. At the root, there is also a SPWeb at root.

You will see your features at :

  • http://server/site/siteCollection/_layouts/ManageFeatures.aspx for Web scoped features
  • http://server/site/siteCollection/_layouts/ManageFeatures.aspx?Scope=Site for Site scoped features

This image (from a previous version of SharePoint, but it's still valid) may help you to understand the concepts :

enter image description here

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.