Newer Version Available
CommunityThemeDefinition
File Suffix and Directory Location
CommunityThemeDefinition components have the suffix .communityThemeDefinition and are stored in the communityThemeDefinitions folder.
Version
CommunityThemeDefinition components are available in API version 38.0 and later.
Special Access Rules
This type is available only if Salesforce Digital Experiences is enabled in your org.
Fields
| Field Name | Field Type | Description |
|---|---|---|
| bundlesInfo | CommunityThemeBundleInfo [ ] | If specified, at least one preview image and one highlight are required. Up to 3 preview images and 4 highlights are supported. Available in API version 44.0 and later |
| customThemeLayoutType | CommunityCustomThemeLayoutType [ ] | The list of custom theme layout types available to the theme layout. |
| defaultBrandingSet | string | The set of branding properties associated with this CommunityThemeDefinition, as defined in the Theme panel in Experience Builder. Available in API version 44.0 and later. |
| description | string | The optional description text of this CommunityThemeDefinition. |
| enableExtendedCleanUpOnDelete | boolean | False by default. Determines if deleting this CommunityThemeDefinition attempts to delete other directly or indirectly referenced objects automatically, for example, FlexiPage. Values are true or false. |
| masterLabel | string | Required. The label for this CommunityThemeDefinition, which displays in Setup. |
| publisher | string | Defines the name of the publisher as seen in the wizard for creating Experience
Builder sites. If no name is provided, the name of the org from which the package
was originally exported is used. This field is available in API version 45.0 and later. |
| themeRouteOverride | CommunityThemeRouteOverride [] | List of theme layout type overrides for flexipages (currently only for home ). Available in API version 44.0 and later. |
| themeSetting | CommunityThemeSetting [] | Required. The list of settings for this CommunityThemeDefinition. |
CommunityThemeBundleInfo
| Field Name | Field Type | Description |
|---|---|---|
| description | string | The optional description text of its CommunityThemeBundleInfo. |
| image | string | Required only when the type is PreviewImage, otherwise this field is optional. A preview image for this CommunityThemeDefinition. |
| order | int | Required. An integer specifying the position of this CommunityThemeBundleInfo relative to others of the same type within its CommunityThemeDefinition. 1 is the first position, 3 is the maximum position for PreviewImage type, and 4 is the maximum position for the Highlight type. |
| title | string | Required. The title of this CommunityThemeBundleInfo to use in code. |
| type | CommunityTemplateBundleInfoType (enumeration of type string) | Required. Stores descriptive information about the theme that is included in
the export. Valid values are:
|
CommunityCustomThemeLayoutType
| Field Name | Field Type | Description |
|---|---|---|
| description | string | The description of the custom theme layout type. |
| label | string | Required. The name of the custom theme layout type. The values Inner, Home, and Login are reserved. |
CommunityThemeRouteOverride
| Field Name | Field Type | Description |
|---|---|---|
| customThemeLayoutType | string | Required when themeLayoutType is not specified. Provides the custom theme layout type associated with the theme layout. This field and themeLayoutType are mutually exclusive; you can’t specify both. |
| pageAttributes | string | Required. Specifies the attributes of the site page for which the default theme layout type is overridden. The only valid value is {"PageName":"Home"}. |
| pageType | string |
Required. Specifies the type of the site page for which the default theme layout type is overridden. The only valid value is comm__standardPage. |
| themeLayoutType | CommunityThemeLayoutType (enumeration of type string) | Required if customThemeLayoutType is not specified. Provides the default theme layout type associated with the theme layout. Valid values are Inner, Home, or Login. This field and customThemeLayoutType are mutually exclusive; you can’t specify both. |
CommunityThemeSetting
| Field Name | Field Type | Description |
|---|---|---|
| customThemeLayoutType | string | Required when themeLayoutType is not specified. The custom theme layout type associated with the theme layout. This field and themeLayoutType are mutually exclusive; you can’t specify both. |
| themeLayout | string | Required. The configuration and layout for this theme. |
| themeLayoutType | CommunityThemeLayoutType (enumeration of type string) | Required when customThemeLayoutType is not specified. The default theme layout type associated with the theme layout. Valid values are Inner, Home, or Login. This field and customThemeLayoutType are mutually exclusive; you can’t specify both. |
Declarative Metadata Sample Definition
The following is an example of a CommunityThemeDefinition component.
1<?xml version="1.0" encoding="UTF-8"?>
2<CommunityThemeDefinition xmlns="http://soap.sforce.com/2006/04/metadata">
3 <bundlesInfo>
4 <description>Batman Feature1 description</description>
5 <order>1</order>
6 <title>Batman Feature1</title>
7 <type>Highlight</type>
8 </bundlesInfo>
9 <bundlesInfo>
10 <image>siteAsset_d90e2d5ce4cf4d8899e233c051091246</image>
11 <order>1</order>
12 <title>siteAsset_d90e2d5ce4cf4d8899e233c051091246</title>
13 <type>PreviewImage</type>
14 </bundlesInfo>
15 <defaultBrandingSet>Batman</defaultBrandingSet>
16 <description>Batman theme</description>
17 <enableExtendedCleanUpOnDelete>true</enableExtendedCleanUpOnDelete>
18 <masterLabel>Batman</masterLabel>
19 <themeRouteOverride>
20 <pageAttributes>{"PageName":"Home"}</pageAttributes>
21 <pageType>comm__standardPage</pageType>
22 <themeLayoutType>Home</themeLayoutType>
23 </themeRouteOverride>
24 <themeSetting>
25 <themeLayout>Batman_themeLayout_Login</themeLayout>
26 <themeLayoutType>Login</themeLayoutType>
27 </themeSetting>
28 <themeSetting>
29 <themeLayout>Batman_themeLayout_Home</themeLayout>
30 <themeLayoutType>Home</themeLayoutType>
31 </themeSetting>
32 <themeSetting>
33 <themeLayout>Batman_themeLayout_Default</themeLayout>
34 <themeLayoutType>Inner</themeLayoutType>
35 </themeSetting>
36</CommunityThemeDefinition>The following is an example package.xml that references the previous definition.
1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3 <types>
4 <members>Batman</members>
5 <name>BrandingSet</name>
6 </types>
7 <types>
8 <members>Batman</members>
9 <name>CommunityThemeDefinition</name>
10 </types>
11 <types>
12 <members>Batman_themeLayout_Default</members>
13 <members>Batman_themeLayout_Home</members>
14 <members>Batman_themeLayout_Login</members>
15 <name>FlexiPage</name>
16 </types>
17 <types>
18 <members>siteAsset_d90e2d5ce4cf4d8899e233c051091246</members>
19 <name>StaticResource</name>
20 </types>
21 <version>51.0</version>
22</Package>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.