Newer Version Available
CommunityTemplateDefinition
Represents the definition of a community
template.
This type extends the Metadata
metadata type and inherits its fullName field.
File Suffix and Directory Location
CommunityTemplateDefinition components have the suffix .communityTemplateDefinition and are stored in the communityTemplateDefinitions folder.
Version
CommunityTemplateDefinition components are available in API version 38.0 and later.
Special Access Rules
This object is available only if Salesforce Communities is enabled in your org.
Fields
| Field Name | Field Type | Description |
|---|---|---|
| bundlesInfo | CommunityTemplateBundleInfo [ ] | Required. The list of preview images and feature descriptions of this CommunityTemplateDefinition. |
| category | CommunityTemplateCategory (enumeration of type string) | Required. The optimized use case of this CommunityTemplateDefinition. Valid
values are:
|
| defaultThemeDefinition | string | Required. The assigned theme definition for this CommunityTemplateDefinition. |
| description | string | The optional description text of this CommunityTemplateDefinition. |
| enableExtendedCleanupUpOnDelete | boolean | Determines if deleting this CommunityTemplateDefinition attempts to delete other directly or indirectly referenced objects automatically, for example, CommunityThemeDefinition, Flexipage, or StaticResource. |
| masterLabel | string | Required. The label for this CommunityTemplateDefinition, which displays in Setup. |
| pageSetting | CommunityTemplatePageSetting [ ] | Required. The list of FlexiPages of this CommunityTemplateDefinition. |
CommunityTemplateBundleInfo
| Field Name | Field Type | Description |
|---|---|---|
| description | string | The optional description text of its CommunityTemplateBundleInfo. |
| image | string | Required only when the type is PreviewImage, otherwise this field is optional. A preview image for this CommunityTemplateDefinition. |
| order | int | 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 max position for PreviewImage type, and 4 is the max position for Highlight type. |
| title | string | Required. The title of this CommunityTemplateBundleInfo to use in code. |
| type | CommunityTemplateBundleInfoType (enumeration of type string) | Required. Stores descriptive information about the template that is included in
the export (currently limited to Features and Preview Images). The template powers
the UI of the Community Creation Wizard. Valid values are:
|
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 <bundlesInfo>
4 <description>ax</description>
5 <order>1</order>
6 <title>ax</title>
7 <type>Highlight</type>
8 </bundlesInfo>
9 <bundlesInfo>
10 <image>siteAsset_6b1cf63e4d604d16bb98b84636ab1932</image>
11 <order>1</order>
12 <title>siteAsset_6b1cf63e4d604d16bb98b84636ab1932</title>
13 <type>PreviewImage</type>
14 </bundlesInfo>
15 <category>Sales</category>
16 <defaultThemeDefinition>ax</defaultThemeDefinition>
17 <description>ax</description>
18 <enableExtendedCleanUpOnDelete>true</enableExtendedCleanUpOnDelete>
19 <masterLabel>ax</masterLabel>
20 <pageSetting>
21 <page>ax_Record_List</page>
22 </pageSetting>
23 <pageSetting>
24 <page>ax_Topic_Catalog</page>
25 </pageSetting>
26 <pageSetting>
27 <page>ax_User_Settings</page>
28 </pageSetting>
29 <pageSetting>
30 <page>ax_Error</page>
31 </pageSetting>
32 <pageSetting>
33 <page>ax_Group_Detail</page>
34 </pageSetting>
35 <pageSetting>
36 <page>ax_Sfdc_Page</page>
37 </pageSetting>
38 <pageSetting>
39 <page>ax_Related_Record_List</page>
40 </pageSetting>
41 <pageSetting>
42 <page>ax_User_Profile</page>
43 </pageSetting>
44 <pageSetting>
45 <page>ax_Record_Detail</page>
46 </pageSetting>
47 <pageSetting>
48 <page>ax_Group_List</page>
49 </pageSetting>
50 <pageSetting>
51 <page>ax_Search</page>
52 </pageSetting>
53 <pageSetting>
54 <page>ax_Create_Record</page>
55 </pageSetting>
56 <pageSetting>
57 <page>ax_Question_Detail</page>
58 </pageSetting>
59 <pageSetting>
60 <page>ax_Home</page>
61 </pageSetting>
62 <pageSetting>
63 <page>ax_Topic_Detail</page>
64 </pageSetting>
65 <pageSetting>
66 <page>ax_Report</page>
67 </pageSetting>
68 <pageSetting>
69 <page>ax_Feed_Detail</page>
70 </pageSetting>
71 <pageSetting>
72 <page>ax_Contact_Support</page>
73 </pageSetting>
74</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>39.0</version>
8</Package>