문제

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

도움이 되었습니까?

해결책

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>

다른 팁

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?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top