Create Custom Content Type Sample

This sample custom content type creates a blog that includes dedicated fields for marketing and presentation information.

This sample is for use with Metadata API or Tooling API. To create custom content types with a graphical user interface, use the CMS Content Type Manager app from AppExchange.

This custom content type includes these fields with their respective attributes and values.

Blog Title

Data type: Text. The display name for the content type.

Attributes:

  • Placeholder text—Enter an SEO friendly title
  • Help text—Title to be shown in the blog post
  • Required—true

Primary Image

Data type: Image

Attributes:

  • Help text—Main image that’s shown at the top of the blog post

Main Content

Data type: Rich text

Attributes:

  • Help text—Blog’s main body
  • Required—true

Excerpt

Data type: Text

Category

Data type: Text

Attributes:

  • Help text—Shown as tag text when a preview is rendered
  • Required—true

Author Name

Data type: Text

Date to Show

Data type: Text

Attributes:

  • Placeholder text—Enter human readable date
  • Required—false

Data type: Rich text

Attributes:

  • Help text—Blog’s footer
  • Required—true

The content creation page for this sample custom content type looks like this after you add it to CMS.

The form for content creation with the custom Blog type

You can add this sample ManagedContentType XML component to CMS with Metadata API.

You can add this sample ManagedContentType JSON object to CMS with Tooling API.