SPD015202: ContentType inherits from ContentType |
ContentType typically inherits from a ContentType
CheckId | SPD015202 |
---|---|
TypeName | ContentTypeInheritsFromContentType |
Severity | Information |
Type | ContentType |
A ContentType can reference an existing ContentType in Features and in ListDefinition element. See samples below:
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<ContentType ID="0x0101000728167cd9c94899925ba69c4af6743e"
Name="Financial Document"
Group="Financial Content Types"
Description="Base financial content type"
Version="0">
<FieldRefs>
...
</FieldRefs>
</ContentType>
</Elements>
<ContentType ID="0x0101000728167cd9c94899925ba69c4af6743e"
Name="Financial Document"
Group="Financial Content Types"
Description="Base financial content type"
Version="0">
<FieldRefs>
...
</FieldRefs>
</ContentType>
</Elements>
ContentType in ListDefinition:
<List xmlns:ows="Microsoft SharePoint" Title="Financial Documents"
...
EnableContentTypes="TRUE">
<MetaData>
<ContentTypes>
<ContentType ID="0x01010012841A8869DB425cB829C3875EC558CE01"
Name="$Resources:Document"
Group="$Resources:Document_Content_Types"
Description="$Resources:DocumentCTDesc" >
<FieldRefs>
...
</MetaData>
</List>
...
EnableContentTypes="TRUE">
<MetaData>
<ContentTypes>
<ContentType ID="0x01010012841A8869DB425cB829C3875EC558CE01"
Name="$Resources:Document"
Group="$Resources:Document_Content_Types"
Description="$Resources:DocumentCTDesc" >
<FieldRefs>
...
</MetaData>
</List>
To suppress this violation in XML SharePoint code add the following comment right before the XML tag which causes the rule violation. Learn more about SuppressMessage here.
<!-- "SuppressMessage":{"rule":"SPD015202:ContentTypeInheritsFromContentType","justification":"Provide reason for suppression here"} -->
Disclaimer: The views and opinions expressed in this documentation and in SPCAF do not necessarily reflect the opinions and recommendations of Microsoft or any member of Microsoft. SPCAF and RENCORE are registered trademarks of Rencore. All other trademarks, service marks, collective marks, copyrights, registered names, and marks used or cited by this documentation are the property of their respective owners.