CommunityThemeDefinition

Represents the definition of a theme for an Experience Builder site.

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 

CommunityThemeDefinition components have the suffix .communityThemeDefinition and are stored in the communityThemeDefinitions folder.

Version 

Introduced in API version 38.0.

Special Access Rules 

This type is available only if Salesforce Digital Experiences is enabled in your org.

Fields 

bundlesInfo 

  • Type: CommunityThemeBundleInfo[]
  • Required: No
  • Introduced: API version 44.0
  • Description: If specified, at least one preview image and one highlight are required. Up to 3 preview images and 4 highlights are supported.

customThemeLayoutType 

defaultBrandingSet 

  • Type: string
  • Required: No
  • Introduced: API version 44.0
  • Description: The set of branding properties associated with this CommunityThemeDefinition, as defined in the Theme panel in Experience Builder.

description 

  • Type: string
  • Required: No
  • Description: The optional description text of this CommunityThemeDefinition.

enableExtendedCleanUpOnDelete 

  • Type: boolean
  • Required: No
  • Description: 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 

  • Type: string
  • Required: Yes
  • Description: Required. The label for this CommunityThemeDefinition, which displays in Setup.

publisher 

  • Type: string
  • Required: No
  • Introduced: API version 45.0
  • Description: 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.

themeRouteOverride 

  • Type: CommunityThemeRouteOverride[]
  • Required: No
  • Introduced: API version 44.0
  • Description: List of theme layout type overrides for flexipages (currently only for home).

themeSetting 

  • Type: CommunityThemeSetting[]
  • Required: No
  • Description: Required. The list of settings for this CommunityThemeDefinition.

CommunityCustomThemeLayoutType Type 

Fields 

description 

  • Type: string
  • Required: No
  • Description: The description of the custom theme layout type.

label 

  • Type: string
  • Required: Yes
  • Description: Required. The name of the custom theme layout type. The values Inner, Home, and Login are reserved.

CommunityThemeBundleInfo Type 

Parent Type 

This type extends CommunityTemplateBundleInfo and inherits its fields.

Fields 

description 

  • Type: string
  • Required: No
  • Description: The optional description text of its CommunityThemeBundleInfo.

image 

  • Type: string
  • Required: No
  • Description: Required only when the type is PreviewImage, otherwise this field is optional. A preview image for this CommunityThemeDefinition.

order 

  • Type: int
  • Required: Yes
  • Description: 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 

  • Type: string
  • Required: Yes
  • Description: Required. The title of this CommunityThemeBundleInfo to use in code.

type 

  • Type: CommunityTemplateBundleInfoType (enumeration of type string)
  • Required: Yes
  • Description: Required. Stores descriptive information about the theme that is included in the export.
  • Possible values:
    • Highlight — This CommunityThemeBundleInfo is used as a highlighted feature. Up to 4 are supported.
    • PreviewImage — This CommunityThemeBundleInfo is used as a preview image. Up to 3 are supported.

CommunityThemeRouteOverride Type 

Fields 

customThemeLayoutType 

  • Type: string
  • Required: No
  • Description: Required when themeLayoutType isn’t 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 

  • Type: string
  • Required: Yes
  • Description: 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 

  • Type: string
  • Required: Yes
  • Description: 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 

  • Type: CommunityThemeLayoutType (enumeration of type string)
  • Required: No
  • Description: Required if customThemeLayoutType isn’t 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 Type 

Fields 

customThemeLayoutType 

  • Type: string
  • Required: No
  • Description: Required when themeLayoutType isn’t specified. The custom theme layout type associated with the theme layout. This field and themeLayoutType are mutually exclusive; you can’t specify both.

themeLayout 

  • Type: string
  • Required: Yes
  • Description: Required. The configuration and layout for this theme.

themeLayoutType 

  • Type: CommunityThemeLayoutType (enumeration of type string)
  • Required: No
  • Description: Required when customThemeLayoutType isn’t 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>{&quot;PageName&quot;:&quot;Home&quot;}</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>68.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.