ContentTypeBinding Element (ContentTypeBinding)

Applies to: SharePoint 2016 | SharePoint Foundation 2013 | SharePoint Online | SharePoint Server 2013

Specifies a content type to provision on a list defined in the onet.xml schema.

Definition

<ContentTypeBinding
    ContentTypeId="Text"
    ListUrl="Text" 
    RootWebOnly="TRUE" | "FALSE"
/>

Elements and attributes

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute

Description

ContentTypeId

Required Text. A string that represents the content type ID of the site content type to add to the specified list.

ListUrl

Required Text. A string that represents the Web-relative path to the list to which to add the content type.

RootWebOnly

Optional Boolean. TRUE to associate this binding only on the root website in a site collection.

Child elements

None

Parent elements

Elements Element (ContentTypeBinding)

Remarks

Lists defined in the onet.xml schema cannot be modified directly.

Example

Following is an example of the ContentTypeBinding element specifying the content type to bind to the specified list.

    <?xml version="1.0" encoding="utf-8" ?> 
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
        <ContentTypeBinding ContentTypeId="0x010102" ListUrl="Shared Documents" />
        <ContentTypeBinding ContentTypeId="0x010108" ListUrl="Shared Documents" />
    </Elements>

See also