Issue with creating child Content Type inherits from a base content type in Share point 2010


HTML clipboard

Problem:

 

In a  scenario ,when I  created a new Content Type in SharePoint 2010 which was inherits from out of box Publishing Base Page content type. I built the Content Type ID correctly using (Base content type Id+ 00+new Guide) and even included the FieldRefs element. Still, after deployed the Content Type the content type was not appear in Site Content Type Gallery.

 

In correct Content Type Definition:

<ContentType        ID="0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39005375FC6886794eabB5E5BF47C322BC56"

        Name="ContentType_PageBase_Name"

        Description="ContentType_PageBase_Description"

        Group="ContentTypeGroup_Title"

        Sealed="FALSE"

        Version="0">

            <FieldRefs>

            </FieldRefs>

            <DocumentTemplate TargetName="/_layouts/CreatePage.aspx" />

     </ContentType>

 

Solution:

 

In SharePoint 2010 Content Types inheritance works a little different in than it did in SharePoint 2007. SharePoint 2010 introduces the "Inherits" attribute. It is Optional and Boolean. The value of this attribute determines whether the content type inherits fields from its parent content type when it is created.

So you must include the Inherits attribute and set its value to TRUE if, you want to inherit all fields from the parent Content Type. In my case I have included 'Inherits' attribute Inherits="True")

and it works for me.

Corrected Content Type Definition:

<ContentType        ID="0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39005375FC6886794eabB5E5BF47C322BC56"

        Name="ContentType_PageBase_Name"

        Description="ContentType_PageBase_Description"

        Group="ContentTypeGroup_Title"

        Sealed="FALSE"

  Inherits="True"

        Version="0">

            <FieldRefs>

            </FieldRefs>

            <DocumentTemplate TargetName="/_layouts/CreatePage.aspx" />

      </ContentType>