Newer Version Available

This content describes an older version of this product. View Latest

ContentTypeBundle

Represents the definition of enhanced custom content types for use with enhanced CMS workspaces. When you create an enhanced custom content type, deploy this bundle to your org. Enhanced custom content types are displayed as forms with defined fields. When deployed, enhanced custom content types are available for use with enhanced LWR site channels. To use enhanced custom content types with Aura and non-enhanced LWR site channels, use enhanced CMS workspaces resources.

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 the Metadata type and inherits its fullName field.

ContentTypeBundle Structure and Directory Location

ContentTypeBundle components are stored in the contentTypes folder. Here’s an example of how the folder is structured.

1+--myMetadataPackage
2    +--contentTypes (1)
3        +--bbHost (2)
4           +--schema.json (3)
  • The contentTypes folder (1) contains a folder for each enhanced custom content type.
  • Each enhanced custom content type folder is named in the format contentTypeName. In this example (2), the name is bbHost.
  • Each contentTypeName folder contains a JSON file, schema.json (3), that defines the enhanced custom content type. The JSON file contains a title and one or more Lightning property types. Use this file to edit the properties of the enhanced custom content type on your local machine or scratch org and then deploy it.

Version

ContentTypeBundle components are available in version 64.0 and later.

Special Access Rules

ContentTypeBundle is available only when Salesforce CMS and digital experiences are enabled for your org.

Fields

Name Description
description
Type
string
Description
Explanatory text about the content type.
masterLabel
Type
string
Description
Required.
A name for ContentTypeBundle, which is defined when the ContentTypeBundle is created.
resources
Type
ContentTypeBundleResource[]
Description
A list of source files in the ContentTypeBundle folder.

ContentTypeBundleResource

Represents the resource file inside the ContentTypeBundle.

Name Description
fileName
Type
string
Description
Required.
The name of the resource file.
filePath
Type
string
Description
Required.
The path to the resource.
source
Type
base64Binary
Description
Required.
The content of the resource.

Declarative Metadata Sample Definition

This package.xml retrieves all of the ContentTypeBundle components in an org.

1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3    <types>
4        <members>*</members>
5        <name>ContentTypeBundle</name>
6    </types>
7    <version>64.0</version>
8</Package>

In the retrieved .zip file, each enhanced custom content type is nested under a contentTypes folder.

This example shows the directory structure in the .zip file of an enhanced custom content type. The enhaced custom content type is named bbHost and in this example it represents the profile of a bed and breakfast host.

1contentTypes
2    bbHost
3        schema.json

Here are the example contents of the schema.json file in the contentTypes directory. The bbHost is a complex type that includes subproperties for fullName, aboutMe, interests, profilePicture, dateOfBirth, lastModified, personalWebsite, hostIdentityVerified, hostingExperienceInYears, rating, residenceCountry, and preferredModeOfContact. Each subproperty is a primitive type. The subproperty types included in the schema.json file are completely configurable and must include a lightning:type for each property.

1{
2  "title": "Bed & Breakfast Host",
3  "description": "Schema for capturing B&B host details",
4  "lightning:type": "lightning__objectType",
5  "lightning:mixinTypes": {
6    "sfdc_cms:metadataContent": {}
7  },
8  "properties": {
9    "fullName": {
10      "title": "Full Name",
11      "lightning:type": "lightning__textType",
12      "lightning:textIndexed": true,
13      "minLength": 5,
14      "maxLength": 50,
15      "lightning:uiOptions": {
16        "placeholderText": "Enter your full name (e.g., John Doe)"
17      },
18      "lightning:localizable": false
19    },
20    "aboutMe": {
21      "title": "About Me",
22      "lightning:type": "lightning__richTextType",
23      "minLength": 10,
24      "maxLength": 3000,
25      "lightning:textIndexed": false,
26      "lightning:uiOptions": {
27        "placeholderText": "Write something about yourself"
28      },
29      "lightning:localizable": true
30    },
31    "interests": {
32      "title": "Interests and Hobbies",
33      "lightning:type": "lightning__multilineTextType",
34      "lightning:textIndexed": true,
35      "minLength": 10,
36      "maxLength": 500,
37      "lightning:uiOptions": {
38        "placeholderText": "Summarize your interests and hobbies in a few lines"
39      },
40      "lightning:localizable": true
41    },
42    "profilePicture": {
43      "title": "Profile Picture",
44      "lightning:type": "lightning__imageType",
45      "lightning:uiOptions": {
46        "placeholderText": "Upload a professional headshot"
47      },
48      "lightning:localizable": false
49    },
50    "dateOfBirth": {
51      "title": "Date of Birth",
52      "lightning:type": "lightning__dateType",
53      "lightning:localizable": true,
54      "lightning:uiOptions": {
55        "placeholderText": "Select your date of birth"
56      }
57    },
58    "lastModified": {
59      "title": "Last Profile Update",
60      "lightning:type": "lightning__dateTimeType",
61      "lightning:localizable": false,
62      "lightning:uiOptions": {
63        "placeholderText": "Auto-filled on profile update"
64      }
65    },
66    "personalWebsite": {
67      "title": "Personal Website",
68      "lightning:type": "lightning__urlType",
69      "lightning:localizable": false,
70      "lightning:uiOptions": {
71        "placeholderText": "https://yourwebsite.com"
72      }
73    },
74    "hostIdentityVerified": {
75      "title": "Host Identity Verified",
76      "lightning:type": "lightning__booleanType",
77      "lightning:uiOptions": {
78        "placeholderText": "Check if host identity is verified"
79      }
80    },
81    "hostingExperienceInYears": {
82      "title": "Years of Experience hosting B&B",
83      "lightning:type": "lightning__integerType",
84      "minimum": 0,
85      "maximum": 50,
86      "lightning:localizable": false,
87      "lightning:uiOptions": {
88        "placeholderText": "Enter total years of experience being a B&B host"
89      }
90    },
91    "rating": {
92      "title": "Rating",
93      "lightning:type": "lightning__numberType",
94      "minimum": 0.0,
95      "maximum": 5.0,
96      "lightning:localizable": false,
97      "lightning:uiOptions": {
98        "placeholderText": "e.g., 4.5"
99      }
100    },
101    "residenceCountry": {
102      "title": "Country of Residence",
103      "lightning:type": "lightning__textType",
104      "const": ["India"]
105    },
106    "preferredModeOfContact": {
107      "title": "Preferred Mode of Contact",
108      "lightning:type": "lightning__textType",
109      "enum": ["email", "SMS", "phone"],
110      "lightning:uiOptions": {
111        "placeholderText": "Choose your preferred mode of contact"
112      }
113    }
114  },
115  "required": ["fullName", "hostIdentityVerified"]
116

Usage

For each custom content type that you create, you must also create a CMS content page created in the enhanced LWR, LWR, or Aura site that displays the content. Each content page serves as the detail page for all content of a single content type. See Create Custom Site Pages with Experience Builder.

To use enhanced custom content types with Aura and non-enhanced LWR site channels, use the enhanced CMS workspaces resources for CMS Delivery Contents and CMS Delivery Content.

Wildcard Support in the Manifest

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 with the Zip .