Condividi tramite


ContentTypes Element (List)

Applies to: SharePoint Foundation 2010

Contains references to content types to associate with lists that are created through the list definition.

<ContentTypes>
</ContentTypes>

Attributes

None.

Child Elements

ContentType, ContentTypeRef

Parent Elements

MetaData (List), MetaData (Site)

Occurrences

Minimum: 0

Maximum: 1

Example

The following example shows a partial definition for a list that uses three content types.

<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>

See Also

Tasks

How to: Add a Content Type to a SharePoint List