Custom Information in Content Types

Applies to: SharePoint Foundation 2010

Available in SharePoint Online

By design, content types are extensible. You can include custom information in content type definitions by adding special XML nodes. These XML nodes are represented by the XmlDocument Element (ContentType) element in the content type definition, and you can access them programmatically through the object model. A content type can include any number of XMLDocument elements. The contents of each XMLDocument element can conform to any given schema; however, they must be valid XML.

By including your custom information within XMLDocument elements in the content type, you can ensure that the custom information you need to implement your solution is encapsulated within and becomes part of the content type.

XMLDocument elements included in a site content type are also copied into any children based on that content type.

You can add this information to a content type in two ways:

If you make a change to an XML document and then perform a push-down operation, the entire XML document is overwritten in any child content types. For more information, see Updating Child Content Types.

XML Document Schemas Included with SharePoint Foundation

SharePoint Foundation itself includes pre-defined XML documents you can use to specify custom forms for a content type, or to specify client-side redirects to different form pages for a content type.

FormTemplates Schema Overview

This schema enables you to specify the form templates used to display an item's Display, New, and Edit pages in the SharePoint Foundation user interface.

FormUrls Schema Overview

This schema enables you to specify client-side redirects to different Display, Edit, and New form pages for items of this content type.

See Also

Concepts

Introduction to Content Types

Content Type Definitions

Other Resources

SPContentType Object Overview