Sharepoint 2010 - Hide Title field in custom content type

Now I define a new Custom List Definition inside the Custom Content Type . The problem is simply that the Title field associated with this list cannot be hidden, I followed some approaches found in the links below, but with no success.

By simply adding a List definition without implementing a content type, the Title field will disappear, but when determining the type of content and its fields, it is always displayed.

Elements.xml

  <ContentType ID="0x01003EBF692DD17B4F71966712180C0D23D8" Name="ContactUsAssignments" Description="Contact Us Assignments content type"> <FieldRefs> <FieldRef ID="{4B888F48-A039-46D0-B2E1-C67802097069}"/> <FieldRef ID="{6238a52d-2975-4e8a-9a1e-31b9cdc74129}"/> <RemoveFieldRef ID="{D3D0DDF1-F791-4FFF-893C-0C100B724F1A}" /> </FieldRefs> </ContentType> 

I also tried Inherits="FALSE" Version="0" , but unfortunately nothing has changed.

Schema.xml

  <ContentTypes> <ContentTypeRef ID="0x01003EBF692DD17B4F71966712180C0D23D8"></ContentTypeRef> </ContentTypes> <Fields> <Field Type="Text" DisplayName="Title" Required="FALSE" ID="{D3D0DDF1-F791-4FFF-893C-0C100B724F1A}" StaticName="Title" Name="Title" Hidden="TRUE" /> </Fields> 

I don’t know for sure if I missed something, but the approach is clear enough. Thanks.

+4
source share
6 answers

All the answers mentioned here have been tested, but without success. After much research and attribute combinations, I came up with the answer below as a working one.

a. In the Elements.xml file on each list Definition make sure that

Inherited = "FALSE"

for Content Type .

Hidden = "TRUE" Required = "FALSE" DisplayName = "_ hidden"

for the field " Title " definition.

 <ContentType ID="0x01007F465964D8114436BD7D7CF2C2D8CF01" Name="Categories" Group="Category CT" Description="Category content type" Inherits="FALSE"> <FieldRefs> <FieldRef ID="{BA7EBEF9-338B-45DE-9743-E394873060A7}"/> <FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Hidden="TRUE" Required="FALSE" DisplayName="_hidden" /> </FieldRefs> </ContentType> 

b. Remove any link for the Title Field on schema.xml

+10
source

Here is a method that works for all of our projects:

In the element.xml element, where all your custom content types are listed, add the following line to hide the "Title" field. Make sure the same GUID has an OOTB SharePoint Title field:

 <FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" DisplayName="Title" Required="FALSE" Hidden="TRUE" /> 

Required property = "FALSE" and Hidden = "TRUE" are crutial. These lines will work in the content type.

Another modification is the definition of the type of content. It should look like this:

 <ContentType ID="0x01005E47745D75A5422A9688FDCC0E6E855A" Name="Links" Group="YourGroup" Description="YouDescription Inherits="FALSE" Version="0"> 

Inherits = "FALSE" is crutial too, because the content type must stop inheriting the properties of the default element to hide the field and make it optional.

Hope this helps,

Andrew

+2
source

Have you tried adding a header field definition in the Elements.xml file above the ContentType definition? I found two examples of adding field definitions to the elements.xml file below. You can try to do this and set the value to “Required for False” and “Hide” to “True” and see if this works.

http://msdn.microsoft.com/en-us/library/gg295290%28v=office.14%29.aspx

http://www.codeproject.com/Articles/410880/SharePoint-2010-Creating-a-Custom-Content-Type-usi

I never did this in the exact same way, however, I sometimes cheated and completely removed the content types from the list definition (on the left as <ContentTypes / ">) and declared fields like yours in Schema.xml. thus overriding the default field for me.

0
source

Try specifying the removal of the Title field in addition to Inherits = "False". for instance

 <?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <!-- Parent ContentType: Item (0x01) Tracked user activity. --> <ContentType ID="0x0100c592d12a1dfa42ae8614d54f45118f83" Name="User Activity" Group="User Activity Tracking" Description="Tracked user activity." Inherits="FALSE" Version="0"> <FieldRefs> <!--Title field inherited from parent Item content type is not required.--> <RemoveFieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" /> <FieldRef ID="{B2FCBA31-5888-4CB9-BCC8-7B1943161B40}" Name="UserActivityCreatedBy"/> <FieldRef ID="{B3F666F7-2DA3-402C-A1A2-A6AA9F4E3E86}" Name="UserActivityType"/> <FieldRef ID="{ABF63CC0-6201-44E7-BA8E-4C0116E5B09F}" Name="UserActivityTimeStamp"/> </FieldRefs> </ContentType> </Elements> 

In the list definition, add ref to the content type

  <ContentTypes> <ContentTypeRef ID="0x0100c592d12a1dfa42ae8614d54f45118f83"/> </ContentTypes> 

And in the "Fields" section, the "Title" field is not described

 <Fields> <Field ID="{b2fcba31-5888-4cb9-bcc8-7b1943161b40}" Name="UserActivityCreatedBy" Type="User" List="UserInfo" ShowField="Title" UserSelectionMode="0" UserSelectionScope="0" ReadOnlyEnforced="TRUE" Required="TRUE" DisplayName="Created By" StaticName="UserActivityCreatedBy" Group="User Activity Tracking"/> <Field ID="{b3f666f7-2da3-402c-a1a2-a6aa9f4e3e86}" Name="UserActivityType" Type="Choice" Format="Dropdown" FillInChoice="FALSE" DisplayName="Type" StaticName="UserActivityType" Group="User Activity Tracking"> <Default>HttpRequest</Default> <CHOICES> <CHOICE>Login</CHOICE> <CHOICE>HttpRequest</CHOICE> <CHOICE>TermsOfUsageAcceptance</CHOICE> </CHOICES> </Field> <Field ID="{abf63cc0-6201-44e7-ba8e-4c0116e5b09f}" Name="UserActivityTimeStamp" Type="DateTime" Format="DateTime" StorageTZ="UTC" DisplayName="Time Stamp" StaticName="UserActivityTimeStamp" Group="User Activity Tracking"/> </Fields> 

Also do not forget to describe the corresponding view - the ViewFields section

  <ViewFields> <FieldRef Name="UserActivityCreatedBy" /> <FieldRef Name="UserActivityType" /> <FieldRef Name="UserActivityTimeStamp" /> </ViewFields> 
0
source

Here is a solution that works great for me:

This is my content type.

 <ContentType ID="0x0100a2045db65601406a95f8f050642655b7" Name="MyContentType" Group="Custom Content Types" Description="Content Type Description" Inherits="FALSE" Version="0"> <FieldRefs> <!--removing the reference from the Title field--> <RemoveFieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" /> .... </FieldRefs> 

This is my section of Schema.xml with a link to my content type. You must remove the header field from the fields of the form schema.xml.

  <ContentTypes> <ContentTypeRef ID="0x0100a2045db65601406a95f8f050642655b7"/> </ContentTypes> ..... <View BaseViewID="1" Type="HTML" WebPartZoneID="Main" DisplayName="MyView" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="AllItems.aspx"> <Toolbar Type="Standard" /> <XslLink Default="TRUE">main.xsl</XslLink> <RowLimit Paged="TRUE">30</RowLimit> <ViewFields> <FieldRef Name="ID"></FieldRef> <!--Delete the reference below --> <FieldRef Name="LinkTitle"></FieldRef> </ViewFields> ..... 

This works great for me! My list still has a column called title, but my content type does not have a column called "Title", so it is hidden from new forms, editform and form pages.

0
source

You might want to use the code in the event receiver:

  private void HideTitleFormField(SPList list) { SPContentTypeCollection listCTCollection = list.ContentTypes; foreach (SPContentType ct in listCTCollection) { SPFieldLinkCollection fieldLinks = ct.FieldLinks; //whilst we are here: hide the file name so it cant be edited. fieldLinks["Title"].Hidden = true; fieldLinks["Title"].Required = false; ct.Update(); } } 
0
source

All Articles