Declaratively remove Title column from a Content Type in Share Point with RemoveFieldRef

Ashok Raja
 
Solutions Architect
January 1, 2013
 
Rate this article
 
Views
528

As Title column is a part of Item Content Type in SharePoint, this column will be added by default to all the content types inherited from Item Content Type. To declaratively remove a column from a content type, RemoveFieldRef element can be used in a Content Type’s declaration.

Points to Consider

1. Ensure that Inherits attribute is set to False in the declaration of Content Type

2. Add a RemoveFieldRef element in FieldRefs segment of content type with Name set to Title and ID set to {fa564e0f-0c70-4ab9-b863-0177e6ddd247}

Sample Code

 <?xml version="1.0" encoding="utf-8"?>
 <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
     <Field ID="{083AF243-688D-431A-8393-420FF838DF73}" Name="DemoColumn1" Group="Demo Group" DisplayName="Demo Column1" Type ="Text" />
     <Field ID="{0ACFBEC9-BC13-48F3-90B7-BA0600808118}" Name="DemoColumn2" DisplayName="Demo Column2" Group="Demo Group" Type ="Lookup" Mult="FALSE" Overwrite="TRUE" ShowField="Title" List="Lists/Category" />
     <!-- Parent ContentType: Item (0x01) -->
     <ContentType ID="0x0100e52212c906c741e19aa4bf85158533df"
                  Name="SFS.Tutorials.Basics - SFS Demo Content Type"
                  Group="Demo Content Types"
                  Description="Demo Content Type for Blog"
                  Inherits="FALSE"
                  Version="0">
         <FieldRefs>
             <RemoveFieldRef  ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" />
             <FieldRef ID="{083AF243-688D-431A-8393-420FF838DF73}"  Name="DemoColumn1"    DisplayName="Demo Column 1"  />
             <FieldRef ID="{0ACFBEC9-BC13-48F3-90B7-BA0600808118}" Name="DemoColumn2"  DisplayName="Demo Column 2"  />
         </FieldRefs>
     </ContentType>
 </Elements>
Category : Tips

Author Info

Ashok Raja
 
Solutions Architect
 
Rate this article
 
I am Ashok Raja, Share Point Consultant and Architect based out of Chennai, India. ...read more
 

Leave a comment