CommunityTemplateDefinition

Represents the definition of an Experience Builder site template.

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 

CommunityTemplateDefinition components have the suffix .communityTemplateDefinition and are stored in the communityTemplateDefinitions 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 

baseTemplate 

  • Type: CommunityBaseTemplate (enumeration of type string)
  • Required: No
  • Description: Denotes that this CommunityTemplateDefinition was created in API version 41.0 or later. The only valid value is c. This field is available in API 41.0 and later.

bundlesInfo 

  • Type: CommunityTemplateBundleInfo[]
  • Required: No
  • Description: The list of preview images and feature highlights of this CommunityTemplateDefinition.

category 

  • Type: CommunityTemplateCategory (enumeration of type string)
  • Required: Yes
  • Description: Required. The optimized use case of this CommunityTemplateDefinition.
  • Possible values:
    • Commerce
    • IT
    • Marketing
    • Sales
    • Service

defaultBrandingSet 

  • Type: string
  • Required: No
  • Introduced: API version 40.0
  • Description: The set of branding properties associated with this CommunityTemplateDefinition, as defined in the Theme panel in Experience Builder. In API version 44.0 and later, this field is read-only and can be implemented in CommunityThemeDefinition.

defaultThemeDefinition 

  • Type: string
  • Required: Yes
  • Description: Required. The assigned theme definition for this CommunityTemplateDefinition.

description 

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

enableExtendedCleanUpOnDelete 

  • Type: boolean
  • Required: No
  • Description: False by default. Determines if deleting this CommunityTemplateDefinition attempts to delete other directly or indirectly referenced objects automatically, for example, CommunityThemeDefinition, Flexipage, or StaticResource. Values are true or false.

masterLabel 

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

navigationLinkSet 

  • Type: NavigationLinkSet[]
  • Required: No
  • Version: Available in API versions 37.0 to 46.0.
  • Description: The navigation menu associated with this CommunityTemplateDefinition. A navigation menu consists of items that users can click to go to other parts of the site. In API versions 47.0 and later, use NavigationMenu.

pageSetting 

publisher 

  • Type: string
  • Required: No
  • Introduced: API version 45.0
  • Description: Defines the name of the publisher as seen in the Change Theme wizard. If no name is provided, the name of the org from which the package was originally exported is used.

CommunityTemplateBundleInfo Type 

Fields 

description 

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

image 

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

order 

  • Type: int
  • Required: Yes
  • Description: Required. An integer specifying the position of this CommunityTemplateBundleInfo relative to others of the same type within its CommunityTemplateDefinition. 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 CommunityTemplateBundleInfo to use in code.

type 

  • Type: CommunityTemplateBundleInfoType (enumeration of type string)
  • Required: Yes
  • Description: Required. Stores descriptive information about the template that’s included in the export. The template powers the interface of the Experience Creation Wizard.
  • Possible values:
    • Highlight — This CommunityTemplateBundleInfo is used as a highlighted feature. Up to 4 are supported.
    • PreviewImage — This CommunityTemplateBundleInfo is used as a preview image. Up to 3 are supported.

CommunityTemplatePageSetting Type 

Fields 

page 

  • Type: string
  • Required: Yes
  • Description: Required. The list of FlexiPage of this CommunityTemplateDefinition.

themeLayout 

  • Type: string
  • Required: Yes
  • Introduced: API version 39.0
  • Description: Required. The name of the FlexiPage for the theme layout.

NavigationMenuItem Type 

Fields 

defaultListViewId 

  • Type: string
  • Required: No

label 

  • Type: string
  • Required: Yes
  • Description: The label that identifies this component in the Salesforce UI and in metadata listings. Character limits and translation behavior follow the enclosing type.

menuItemBranding 

position 

  • Type: int
  • Required: Yes

publiclyAvailable 

  • Type: boolean
  • Required: No

subMenu 

target 

  • Type: string
  • Required: No

targetPreference 

  • Type: string
  • Required: No

type 

  • Type: string
  • Required: Yes

NavigationSubMenu Type 

A list of child menu items. Only NavigationMenuItem items of type MenuLabel can have items in a NavigationSubMenu. Available in API 39.0 and later.

Fields 

navigationMenuItem 

Declarative Metadata Sample Definition 

The following is an example of a CommunityTemplateDefinition component.

1<?xml version="1.0" encoding="UTF-8"?>
2<CommunityTemplateDefinition xmlns="http://soap.sforce.com/2006/04/metadata">
3    <baseTemplate>c</baseTemplate>
4    <bundlesInfo>
5        <description>Feature Description</description>
6        <order>1</order>
7        <title>Feature Heading</title>
8        <type>Highlight</type>
9    </bundlesInfo>
10    <bundlesInfo>
11        <image>siteAsset_2dbe594eb6794173af78da264cd6a4a7</image>
12        <order>1</order>
13        <title>Preview Image</title>
14        <type>PreviewImage</type>
15    </bundlesInfo>
16    <category>Sales</category>
17    <defaultThemeDefinition>communityTemplate</defaultThemeDefinition>
18    <description>This is an Experience Builder template</description>
19    <enableExtendedCleanUpOnDelete>true</enableExtendedCleanUpOnDelete>
20    <masterLabel>communityTemplate</masterLabel>
21    <navigationLinkSet>
22        <navigationMenuItem>
23            <label>Topics</label>
24            <position>0</position>
25            <publiclyAvailable>true</publiclyAvailable>
26            <target>ShowMoreTopics</target>
27            <type>NavigationalTopic</type>
28        </navigationMenuItem>
29    </navigationLinkSet>
30    <pageSetting>
31        <page>communityTemplate_Report_List</page>
32        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
33    </pageSetting>
34    <pageSetting>
35        <page>communityTemplate_Topic_Catalog</page>
36        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
37    </pageSetting>
38    <pageSetting>
39        <page>communityTemplate_Check_Password</page>
40        <themeLayout>communityTemplate_themeLayout_Login</themeLayout>
41    </pageSetting>
42    <pageSetting>
43        <page>communityTemplate_Error</page>
44        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
45    </pageSetting>
46    <pageSetting>
47        <page>communityTemplate_User_Settings</page>
48        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
49    </pageSetting>
50    <pageSetting>
51        <page>communityTemplate_Login</page>
52        <themeLayout>communityTemplate_themeLayout_Login</themeLayout>
53    </pageSetting>
54    <pageSetting>
55        <page>communityTemplate_Stream_List</page>
56        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
57    </pageSetting>
58    <pageSetting>
59        <page>communityTemplate_Sfdc_Page</page>
60        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
61    </pageSetting>
62    <pageSetting>
63        <page>communityTemplate_Group_Detail</page>
64        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
65    </pageSetting>
66    <pageSetting>
67        <page>communityTemplate_Report_Related_List</page>
68        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
69    </pageSetting>
70    <pageSetting>
71        <page>communityTemplate_Register</page>
72        <themeLayout>communityTemplate_themeLayout_Login</themeLayout>
73    </pageSetting>
74    <pageSetting>
75        <page>communityTemplate_User_Profile</page>
76        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
77    </pageSetting>
78    <pageSetting>
79        <page>communityTemplate_Case_Detail</page>
80        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
81    </pageSetting>
82    <pageSetting>
83        <page>communityTemplate_Stream_Related_List</page>
84        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
85    </pageSetting>
86    <pageSetting>
87        <page>communityTemplate_Dashboard_Detail</page>
88        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
89    </pageSetting>
90    <pageSetting>
91        <page>communityTemplate_Group_List</page>
92        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
93    </pageSetting>
94    <pageSetting>
95        <page>communityTemplate_Canvasapp_Page</page>
96        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
97    </pageSetting>
98    <pageSetting>
99        <page>communityTemplate_Login_Error</page>
100        <themeLayout>communityTemplate_themeLayout_Login</themeLayout>
101    </pageSetting>
102    <pageSetting>
103        <page>communityTemplate_Create_Record</page>
104        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
105    </pageSetting>
106    <pageSetting>
107        <page>communityTemplate_Group_Related_List</page>
108        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
109    </pageSetting>
110    <pageSetting>
111        <page>communityTemplate_Search</page>
112        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
113    </pageSetting>
114    <pageSetting>
115        <page>communityTemplate_File_Detail</page>
116        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
117    </pageSetting>
118    <pageSetting>
119        <page>communityTemplate_Case_List</page>
120        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
121    </pageSetting>
122    <pageSetting>
123        <page>communityTemplate_User_List</page>
124        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
125    </pageSetting>
126    <pageSetting>
127        <page>communityTemplate_File_List</page>
128        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
129    </pageSetting>
130    <pageSetting>
131        <page>communityTemplate_Question_Detail</page>
132        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
133    </pageSetting>
134    <pageSetting>
135        <page>communityTemplate_Dashboard_List</page>
136        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
137    </pageSetting>
138    <pageSetting>
139        <page>communityTemplate_Related_Record_List</page>
140        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
141    </pageSetting>
142    <pageSetting>
143        <page>communityTemplate_File_Related_List</page>
144        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
145    </pageSetting>
146    <pageSetting>
147        <page>communityTemplate_Record_List</page>
148        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
149    </pageSetting>
150    <pageSetting>
151        <page>communityTemplate_Forgot_Password</page>
152        <themeLayout>communityTemplate_themeLayout_Login</themeLayout>
153    </pageSetting>
154    <pageSetting>
155        <page>communityTemplate_Home</page>
156        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
157    </pageSetting>
158    <pageSetting>
159        <page>communityTemplate_Dashboard_Related_List</page>
160        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
161    </pageSetting>
162    <pageSetting>
163        <page>communityTemplate_Account_Management</page>
164        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
165    </pageSetting>
166    <pageSetting>
167        <page>communityTemplate_Case_Related_List</page>
168        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
169    </pageSetting>
170    <pageSetting>
171        <page>communityTemplate_User_Related_List</page>
172        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
173    </pageSetting>
174    <pageSetting>
175        <page>communityTemplate_Stream_Detail</page>
176        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
177    </pageSetting>
178    <pageSetting>
179        <page>communityTemplate_Topic_Detail</page>
180        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
181    </pageSetting>
182    <pageSetting>
183        <page>communityTemplate_Messages</page>
184        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
185    </pageSetting>
186    <pageSetting>
187        <page>communityTemplate_Report_Detail</page>
188        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
189    </pageSetting>
190    <pageSetting>
191        <page>communityTemplate_Record_Detail</page>
192        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
193    </pageSetting>
194    <pageSetting>
195        <page>communityTemplate_Feed_Detail</page>
196        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
197    </pageSetting>
198    <pageSetting>
199        <page>communityTemplate_Contact_Support</page>
200        <themeLayout>communityTemplate_themeLayout_Default</themeLayout>
201    </pageSetting>
202</CommunityTemplateDefinition>

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>MyTemplate</members>
5        <name>CommunityTemplateDefinition</name>
6    </types>
7    <version>68.0</version>
8</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.