ManagedContentType

Represents the definition of custom content types for use with Salesforce CMS. Custom content types are displayed as forms with defined fields.

Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

Important

Parent Type 

This type extends Metadata and inherits its fields.

File Suffix and Directory Location 

ManagedContentType components have the suffix managedContentType and are stored in the managedContentTypes folder.

Version 

Introduced in API version 47.0.

Special Access Rules 

ManagedContentType is only available if Salesforce CMS and digital experiences are enabled for your org.

Fields 

description 

  • Type: string
  • Required: No
  • Description: Describes the custom content type defined in this ManagedContentType declaration.

developerName 

  • Type: string
  • Required: Yes
  • Description: Required. Unique name for the custom content type. For example: OurSpecialContent_c

isMetadataContent 

  • Type: boolean
  • Required: No
  • Description: When true, any content created from this content type is converted to metadata. Default value is false. Availabe in API version 63.0 and later.

managedContentNodeTypes 

  • Type: ManagedContentNodeType[]
  • Required: No
  • Description: Nodes included as part of this custom content type. When rendered as a form in the Digital Experiences app, each node is represented as an individual field.

masterLabel 

  • Type: string
  • Required: Yes
  • Description: Required. Declares the name of the content type as it appears in the UI.

ManagedContentNodeType Type 

Represents the structure of individual nodes within the custom content type.

Fields 

helpText 

  • Type: string

  • Required: No

  • Description: Provides assistive text in the UI, displayed as an info bubble for the field. If this field is empty, no info bubble icon or text is displayed.

    For example: <IMG?>

isLocalizable 

  • Type: boolean
  • Required: No
  • Description: Declares a field as localizable and consumable by (true) or not (false). Default is false.

NodeTypes IMG , URL , DATE , and DATETIME can’t be localized.

Note

isRequired 

  • Type: boolean
  • Required: No
  • Description: Declares a field as required (true) or not (false). Fields declared as required are indicated by a red asterisk. If a value isn’t added to the field in the custom content type, the form can’t be saved and a standard error is displayed. Default is false.

When nodeType is set to NAMEFIELD on a field, isRequired must also be set to True for that field.

Note

nodeLabel 

  • Type: string

  • Required: Yes

  • Description: Required. Declares the label for the field as it appears in the UI.

    In enhanced workspaces, the system generates a Title field by default. To prevent having multiple Title fields on the UI when you create a custom content type for use in an enhanced workspace, don’t use Title as the label for nodeLabel.

nodeName 

  • Type: string

  • Required: Yes

  • Description: Required. Unique name of the nodeType within the content type. nodeName is a simple text field that allows up to 100 alphanumeric characters and underscores. The name must begin with a letter, not include spaces, can’t have two consecutive underscores, and can’t end with an underscore.

    In enhanced workspaces, the system generates a Title field by default. To prevent having multiple Title fields on the UI when you create a custom content type for use in an enhanced workspace, don’t use Title as the label for nodeName.

nodeType 

  • Type: MCNodeType (enumeration of type string)
  • Required: Yes
  • Description: Required. Identifies the supported type of content in the node. Passed as a string. There’s a maximum of 15 node types per content type. Values are case insensitive but are returned in all capital letters as shown.
  • Possible values:
    • TEXT — Simple text node (max length=255 characters)
    • MTEXT — Multi-line text node (max length=2000 characters)
    • RTE — Rich text node (max length=65536 characters)
    • IMG — Image node
    • URL — URL node (max length=255 characters)
    • DATE — Date node
    • DATETIME — Datetime node
    • NAMEFIELD

IMG node types can’t be localized. Set isLocalizable to false for images.

Note

URL accepts protocol string values starting with http://, https://, mailto:, tel:, and /.

Note

URL node types can’t be localized. Set isLocalizable to false for URLs.

Note

DATE accepts dates only in the format yyyy-MM-dd.

Note

DATE node types can’t be localized. Set isLocalizable to false for dates.

Note

DATETIME accepts date and time in the format: yyyy-MM-dd’T’HH:mm:ss.SSS’Z’ (UTC datetime in ISO 8601 format).

Note

DATETIME node types can’t be localized. Set isLocalizable to false for datetime notes.

Note

NAMEFIELD declares the field as the name that represents the content when referenced in the UI. For example, text entered in this field displays as a list of available content in the Digital Experiences app or as a piece of content available for inclusion in a collection in an Experience Cloud site. One, and only one, nodeType in your managed content type must be declared as NAMEFIELD . NAMEFIELD is a string of 200 characters or fewer. In enhanced workspaces, the system generates a Title field by default. To prevent having multiple Title fields on the UI when you create a custom content type for use in an enhanced workspace, don’t use Title as the label for nodeName or nodeLabel for the NAMEFIELD node. If you’ve already named nodeName Title, choose a different label for nodeLabel to prevent confusion on the content creation page. When NAMEFIELD is used, isRequired must also be set to true for the field.

Note

placeholderText 

  • Type: string
  • Required: No
  • Description: Provides assistive text in the UI, displayed as placeholder, or ghost text, in a field before any entry is made. For example, Enter a title for your article...

Declarative Metadata Sample Definition 

The following is an example of a ManagedContentType component.

1<?xml version="1.0" encoding="UTF-8"?>
2<ManagedContentType xmlns="http://soap.sforce.com/2006/04/metadata">
3  <developerName>myContentType</developerName>
4	<masterLabel>My Content Type</masterLabel>
5	<description>This is the description for my content type</description>
6	<managedContentNodeTypes>
7		<nodeName>title</nodeName>
8		<nodeLabel>Content Title</nodeLabel>
9		<nodeType>NAMEFIELD</nodeType>
10		<placeholderText>Placeholder Text for title</placeholderText>
11		<helpText>Help Text for title</helpText>
12		<isLocalizable>true</isLocalizable>
13		<isRequired>true</isRequired>
14	</managedContentNodeTypes>
15	<managedContentNodeTypes>
16		<nodeName>textnode</nodeName>
17		<nodeLabel>Content Text</nodeLabel>
18		<nodeType>TEXT</nodeType>
19		<placeholderText>Placeholder Text for Content Text</placeholderText>
20		<helpText>Help Text for Content Text</helpText>
21		<isLocalizable>true</isLocalizable>
22		<isRequired>false</isRequired>
23	</managedContentNodeTypes>
24	<managedContentNodeTypes>
25		<nodeName>richtextnode</nodeName>
26		<nodeLabel>Content RichText</nodeLabel>
27		<nodeType>RTE</nodeType>
28
29	</managedContentNodeTypes>
30	<managedContentNodeTypes>
31		<nodeName>multilinetextnode</nodeName>
32		<nodeLabel>Content MultilineText</nodeLabel>
33		<nodeType>MTEXT</nodeType>
34	</managedContentNodeTypes>
35	<managedContentNodeTypes>
36		<nodeName>imagenode</nodeName>
37		<nodeLabel>Content Image</nodeLabel>
38		<nodeType>IMG</nodeType>
39
40	</managedContentNodeTypes>
41</ManagedContentType>

Usage 

For each custom content type you create, there must also be a CMS Content page created in any Experience Cloud site that displays the content. Each Content page serves as the detail page for all content of a single content type. See Create Custom Pages with Experience Builder.

Wildcard Support in the Manifest File 

This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.