8

I am creating a custom content type and it is working correctly with the exception of the Title column. My content type defination has the Title column added to the FieldRefs and I am trying to both change the display name and make it required. However when this is activated there is no change to the Title column - it still shows the display name as Title and it is not required.

Any advice on how to solve this?

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- Parent ContentType: Document (0x0101) -->
  <ContentType ID="0x0101001837fb95615a40a5a5461a736a7fbbf4"
   Name="Core Document Content Type"
   Group="Custom"
   Description="This content type provides a base content type."
   Inherits="TRUE"
   Version="0">
    <FieldRefs>
      <FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" DisplayName="Document Name" Required="TRUE" />
      <FieldRef ID="{157AFA0B-2F58-4185-8222-FB8B71BB5CFE}" Name="DocumentDescription" DisplayName="Document Description" />
    </FieldRefs>
  </ContentType>
</Elements>

Screenshots showing it has not taken effect Add Form http://img163.imageshack.us/img163/752/addform.png List View http://img703.imageshack.us/img703/8711/listb.png Columns in Content Type http://img707.imageshack.us/img707/3444/columns.png

3

2 Answers 2

9

The solution is two fold - first the content type defination needs to have inherit set to false, and the title column needs to have sealed to true (see below). Second issue is that the view will still show title (but the add new item form will show the correct display name). To correct the view a custom list must be defined

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- Parent ContentType: Document (0x0101) -->
  <ContentType ID="0x0101001837fb95615a40a5a5461a736a7fbbf4"
   Name="Core Document Content Type"
   Group="Custom"
   Description="This content type provides a base content type."
   Inherits="FALSE"
   Version="0">
    <FieldRefs>
      <FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" DisplayName="Document Name" Required="TRUE" Sealed="TRUE" />
      <FieldRef ID="{157AFA0B-2F58-4185-8222-FB8B71BB5CFE}" Name="DocumentDescription" DisplayName="Document Description" />
    </FieldRefs>
  </ContentType>
</Elements>
1
  • Thaks for this post, it is worked for me, I could able to make the Title field as Required. My requiremet was to create a custom CT from Document CT and then make the Title field as required. It worked like gem :)
    – user6496
    Commented Jan 20, 2012 at 12:24
0

You can just hide the Title field in the document library.

Go to Advanced Settings - the first option is allow for the management of content types, make sure that says "Yes".

Then in the settings page again, look above the Column section, there's a Content Type section that should say Document. Click on Document which will bring up the Title field. Click on the Title field, it will give you the option to hide it.

Make sense?

1
  • Really need this field, so hiding it doesn't help - need to rename and make required. Manually changing it works but the problem is this needs to be done in the custom content type defination so it can be replicated correctly across multiple site collections without having someone manually update every one. Commented Dec 23, 2010 at 12:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.