Imagine the following scenario: you created a new Content Type in SharePoint 2010. You built the Content Type ID correctly and even included the FieldRefs element. Still, after you provisioned your Content Type it doesn’t contain any fields:

Screenshot of the Site Content Type Information page with a Content Type that doesn't contain any fields

Content Types inheritance works a little different in SharePoint 2010 than it did in SharePoint 2007. SharePoint 2010 introduces the Inherits attribute. From the SharePoint SDK:

Inherits – Optional Boolean. The value of this attribute determines whether the content type inherits fields from its parent content type when it is created.

If Inherits is TRUE, the child content type inherits all fields that are in the parent, including fields that users have added.

If Inherits is FALSE or absent and the parent content type is a built-in type, the child content type inherits only the fields that were in the parent content type when SharePoint Foundation was installed. The child content type does not have any fields that users have added to the parent content type.

If Inherits is FALSE or absent and the parent content type was provisioned by a sandboxed solution, the child does not inherit any fields from the parent.

As you can see, in SharePoint 2010 it is not sufficient to just include the FieldRefs element to include all fields from the parent Content Type as we used to in SharePoint 2007. Instead you must include the Inherits attribute and set its value to TRUE if you want to inherit all fields from the parent Content Type. You don’t have to include the FieldRefs element as you had to in SharePoint 2007.

Screenshot of the Site Content Type Information page with a Content Type that inherits from the Page Content Type and contains fields as expected.

Not including the Inherits attribute can cause a lot of confusion especially if you are used to the way how things worked with SharePoint 2007 and you have been using some tools to simplify the process of creating Content Types.

Technorati Tags: