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


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.

| 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

It should work fine in a signle feature also.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy