Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Is it possible to define a content type, a custom column, a list instance and associate the contenttype to the list using xml, all within the same feature or do they need to be seperated into seperate features?

All the best

share|improve this question
add comment

2 Answers

You should always use appropriate feature scoping. In your scenario you would need:

  • A Site Collection scoped feature which would deploy the Content Type and the Site Column
  • A Web scoped feature which would deploy the list instance and associate the content type.

This is the best way and the best practice to achieve your goal. If they are related then you should add a FeatureActivationDependency as well.

share|improve this answer
1  
Absolutely. Difficult-to-track-down issues can happen if things are not correctly scoped. –  Chris O'Brien - MVP May 6 '10 at 13:41
    
Thanks Charles - is this the case even if the list is to be in the root site collection? –  Anonymous May 6 '10 at 20:18
    
Yes absolutley! The root web is still an SPWeb and should not be treated any differenlty (in this case) –  Charles Lee May 7 '10 at 7:51
add comment

It should work fine in a signle feature also.

share|improve this answer
    
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. –  Hugh Wood Dec 14 '12 at 11:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.