SharePoint content type: remove columns from parent

I am trying to create a content type that will inherit from the Contact content type (which comes with SharePoint). I need the most fields, but I would like to remove some of them.

Is there a way to remove the fields I don't want using the XML content type definition?

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <ContentType ID="0x01004B56BB872BFE984D9611B5D8CF52CB60" Name="Child Contact" Description="Inherits from Contact" Group="...">
    <FieldRefs>
    ??? What would I put there to remove fields that exist in the parent?
    </FieldRefs>
  </ContentType>
</Elements>

      

+2


source to share


4 answers


Use this syntax in defining your content type:

<FieldRefs>
      <RemoveFieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name ="Title"  />
</FieldRefs>

      



You must find the correct ID for each submitted application that you want to delete.

+3


source


Just hide them in the child content type by setting the HIDDEN = "TRUE" attribute. See here for a complete list of attributes.



+1


source


If you don't need these fields, then why are you inheriting this content type in the first place?

0


source


I suggest you rethink your content type inheritance structure. Define a parent ct containing JUST columns shared by both child ct and add other columns to the corresponding child ct.

Think of it like OO programming, you don't put methods that are ONLY used in subclass B that inherits from class A TO of that parent class A, and in the process makes that method available in all classes inheriting from A, whereas they never not be used there, or worse, misused ...

0


source







All Articles