0

I was reading on content types and I see that share point allows allows to create them at site collection and list level scope.

My question is that in visual studio where can we specify whether this is a site collection level or a list level content type? Because the scope of feature is either webap, site, farm or web.

Is there a way to do this via UI?

1 Answer 1

1

I'm pretty sure all content type definitions created in VS are, by default, site content types.

There is no attribute in the Content Type element of a content type definition that allows you to target a specific list.

Even if you were going to create a list definition declaritively in VS, to include a content type in the list you would have to create a content type definition separately, and then base the list definition off the content type definition. But because the content type definition is separate, it will still be deployed as a site content type.

If you want to create a site content type from the UI, you would go to Site Settings, then Site Content Types (under Galleries), and create a new one there.

If you want to create a list content type, you would have to go to the List Settings page for the particular list, go to Advanced Settings and allow the management of content types, then add a pre-existing site content type to the list, and then edit the list level copy of that content type.

EDIT

It seems I was wrong. According to this MSDN article on Site and List Content Types:

You can create a content type collection for a new list as part of the list definition before list instances are provisioned. Within the list definition's ContentTypes element, you can reference existing site content types, and you can also define new content types. In this case, the new content types are available only to list instances that are created from the same list definition. The new content types are not part of the site collection and are not available to other lists.

So it seems that you can create list scoped content types through a list definition created in VS.

2
  • So it looks like the only way to do this is from UI. There is no way to create list scoped content types via VS?
    – variable
    Commented Aug 6, 2014 at 4:08
  • Apparently there is, see my edit. Commented Aug 6, 2014 at 12:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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