Newer Version Available

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

CommunityThemeDefinition

Represents the definition of a community theme.This type extends the Metadata metadata type and inherits its fullName field.

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 Communities is enabled in your org.

Fields

Field Name Field Type Description
bundlesInfo CommunityTheme​BundleInfo [ ] If specified, at least one preview image and one highlight are required. Available in API version 44.0 and later
customThemeLayoutType CommunityCustom​ThemeLayoutType [ ] 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 Branding panel in Experience Builder. Available in API version 44.0 and later.
description string The optional description text of this CommunityThemeDefinition.
enableExtendedCleanupUp​OnDelete 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.
themeRouteOverride CommunityTheme​RouteOverride [ ] List of theme layout type overrides for flexipages (currently only for home ). Available in API version 44.0 and later.
themeSetting CommunityTheme​Setting [ ] Required. The list of settings for this CommunityThemeDefinition.

CommunityTheme​BundleInfo

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 CommunityTemplate​BundleInfoType (enumeration of type string) Required. Stores descriptive information about the theme that is included in the export. Valid values are:
  • Highlight—This CommunityThemeBundleInfo is used as a highlighted feature.
  • PreviewImage—This CommunityThemeBundleInfo is used as a preview image.

CommunityCustom​ThemeLayoutType

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.

CommunityTheme​RouteOverride

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..
themeLayoutType CommunityTheme​LayoutType (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..
pageAttributes string Required. Specifies the attributes of the community 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 community page for which the default theme layout type is overridden. The only valid value is comm__standardPage.

CommunityTheme​Setting

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 CommunityTheme​LayoutType (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>{&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>44.0</version>
22</Package>