ContentTypes 元素 (List)

适用于: SharePoint 2016 |SharePoint Foundation 2013 |SharePoint Online |SharePoint Server 2013

包含对与通过列表定义创建的列表相关的内容类型的引用。

<ContentTypes>
</ContentTypes>

元素和属性

下面各部分介绍了属性、子元素和父元素。

Attributes

子元素

父元素

出现次数

  • 最小值:0
  • 最大值:1

示例

下面的示例演示使用三种内容类型的列表对应的部分定义。

<List xmlns:ows="Microsoft SharePoint" Title="Financial Documents"
  Direction="$Resources:Direction;" Url="Financial Documents"
  BaseType="1"
  EnableContentTypes="TRUE">
  <MetaData>
    <ContentTypes>
      <ContentTypeRef ID="0x01010012841A8869DB425cB829C3875EC558CE01">
        <Folder TargetName="Forms/Document" />
      </ContentTypeRef>
      <ContentTypeRef ID="0x01010012841A8869DB425cB829C3875EC558CE02">
        <Folder TargetName="Forms/Document" />
      </ContentTypeRef>
      <ContentTypeRef ID="0x0120" />
    </ContentTypes>
    ...
  </MetaData>
</List>

另请参阅