Blog Archives

Add a custom content type to a custom list definition

To add a custom content type to a custom list definition , the simple way to do is to add some entries in the schema.xml of the list.

Just add the ContentTypeRef of the contents types you want to use:

  • Add the DisallowContentTypes=”FALSE tag to the Elements.xml for the list;
  • Add the EnableContentTypes=”TRUE tag to the List Definition Schema.xml;

Sometimes i don’t really know the reason but some of the fields are not shown when trying to create a new item in the list.

I solved this problem by copying the field definition in the contents type to the schema.xml of the list. and it works fine.