@salesforce/afv-skills 1.6.6 → 1.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,279 +0,0 @@
1
- # Build Your Own (LWR) Template
2
-
3
- **Use when** creating a new site or retrieving default values for site metadata.
4
-
5
- ## Table of Contents
6
-
7
- - Bootstrap Options
8
- - Default Values Reference
9
-
10
- ## Bootstrap Options
11
-
12
- **IMPORTANT**: First site setup initializes services. Warn user - recommend Option 1 for first site.
13
-
14
- Ask user to choose:
15
-
16
- 1. Create in org, then download metadata
17
- 2. Scaffold locally before deploying
18
-
19
- ### Option 1: Create in Org
20
-
21
- **Step 1:** Run the create command:
22
-
23
- ```bash
24
- sf community create --name "{siteName}" --template-name 'Build Your Own (LWR)' --url-path-prefix "{prefix}" --target-org {usernameOrAlias} --json
25
- ```
26
-
27
- Site creation is an async job. As soon as the terminal returns output, capture the `jobId` and move on — do not wait for the shell command to fully exit.
28
-
29
- **Step 2:** Ask the user: *"Would you like me to wait for the site creation to complete and then retrieve the metadata for you, or would you prefer to retrieve it yourself once it's ready?"*
30
-
31
- **Stop here and wait for the user's response before proceeding.**
32
-
33
- ---
34
-
35
- **If the user wants to wait and retrieve:**
36
-
37
- Poll the `BackgroundOperation` object using the following command, replacing `{jobId}` with the ID returned from the create command:
38
-
39
- ```soql
40
- SELECT Status FROM BackgroundOperation WHERE Id = '{jobId}'
41
- ```
42
-
43
- Use the MCP tool `run_soql_query` to run this query on the given target org. If the MCP tool is not available, run the following command instead, replacing `{jobId}` and `{usernameOrAlias}` with the appropriate values:
44
-
45
- ```bash
46
- sf data query --query "SELECT Status FROM BackgroundOperation WHERE Id = '{jobId}'" --target-org {usernameOrAlias} --json
47
- ```
48
-
49
- Repeat until `Status` is `Complete`. If the query does not return `Complete` after several attempts, ask the user to manually check their target org to confirm whether site creation has completed. **Stop here and do not proceed until the user confirms the site is ready.**
50
-
51
- Once complete, run each of the following retrieval commands **one at a time**. Do not chain them together (e.g. do not use `&&`). Wait for each command to return output before running the next. Metadata types are space-delimited — **never** wrap them in quotes or use commas:
52
-
53
- ```bash
54
- sf project retrieve start --metadata DigitalExperienceBundle --target-org {usernameOrAlias} --json
55
- ```
56
-
57
- ```bash
58
- sf project retrieve start --metadata DigitalExperienceConfig --target-org {usernameOrAlias} --json
59
- ```
60
-
61
- ```bash
62
- sf project retrieve start --metadata Network --target-org {usernameOrAlias} --json
63
- ```
64
-
65
- ```bash
66
- sf project retrieve start --metadata CustomSite --target-org {usernameOrAlias} --json
67
- ```
68
-
69
- ---
70
-
71
- **If the user wants to retrieve themselves:**
72
-
73
- Provide them with the retrieval command to run once the site is ready. Metadata types are space-delimited — **never** wrap them in quotes or use commas:
74
-
75
- ```bash
76
- sf project retrieve start --metadata DigitalExperienceBundle DigitalExperienceConfig Network CustomSite --target-org {usernameOrAlias} --json
77
- ```
78
-
79
- ---
80
-
81
-
82
- ### Option 2: Scaffold Locally
83
-
84
- ```bash
85
- sf template generate digital-experience site --name "{siteName}" --template-name 'Build Your Own (LWR)' --url-path-prefix "{prefix}"
86
- ```
87
-
88
- Generates metadata with defaults: DigitalExperienceConfig, DigitalExperiences, Network, CustomSite, and content (route, view, themeLayout, etc.).
89
-
90
- #### Post-Creation Config
91
-
92
- After site metadata is generated, use MCP tool `execute_metadata_action` to fetch additional information about the template:
93
-
94
- ```json
95
- {
96
- "metadataType": "ExperienceSiteLwr",
97
- "actionName": "getSiteTemplateMetadata",
98
- "parameters": { "templateDevName": "talon-template-byo" }
99
- }
100
- ```
101
-
102
- If result provides `disabledViews`, delete both view and route directories.
103
-
104
- **Example**: If `disabledViews` includes "tooManyRequests":
105
-
106
- - Delete: `digitalExperiences/site/{siteDevName}/sfdc_cms__view/tooManyRequests/`
107
- - Delete: `digitalExperiences/site/{siteDevName}/sfdc_cms__route/Too_Many_Requests/`
108
-
109
- ---
110
-
111
- ## Default Values Reference
112
-
113
- **Note**: CLI generates these. Listed for reference only - use CLI first.
114
-
115
- ### Metadata Defaults
116
-
117
- **DigitalExperienceConfig**:
118
-
119
- ```yaml
120
- label: {siteName}
121
- urlPathPrefix: {siteUrlPathPrefix}
122
- space: site/{siteName}1
123
- ```
124
-
125
- **DigitalExperienceBundle**:
126
-
127
- ```yaml
128
- label: {siteName}1
129
- modules: [sfdc_cms__collection, sfdc_cms__mobilePublisherConfig]
130
- ```
131
-
132
- **Network**:
133
-
134
- ```yaml
135
- allowInternalUserLogin: false
136
- allowMembersToFlag: false
137
- changePasswordTemplate: unfiled$public/CommunityChangePasswordEmailTemplate
138
- disableReputationRecordConversations: true
139
- emailSenderAddress: {adminEmailAddress}
140
- emailSenderName: {siteName}
141
- embeddedLoginEnabled: false
142
- enableApexCDNCaching: true
143
- enableCustomVFErrorPageOverrides: false
144
- enableDirectMessages: true
145
- enableExpFriendlyUrlsAsDefault: false
146
- enableExperienceBundleBasedSnaOverrideEnabled: true
147
- enableGuestChatter: false
148
- enableGuestFileAccess: false
149
- enableGuestMemberVisibility: false
150
- enableImageOptimizationCDN: true
151
- enableInvitation: false
152
- enableKnowledgeable: false
153
- enableLWRExperienceConnectedApp: true
154
- enableMemberVisibility: false
155
- enableNicknameDisplay: true
156
- enablePrivateMessages: false
157
- enableReputation: false
158
- enableShowAllNetworkSettings: false
159
- enableSiteAsContainer: true
160
- enableTalkingAboutStats: true
161
- enableTopicAssignmentRules: true
162
- enableTopicSuggestions: false
163
- enableUpDownVote: false
164
- forgotPasswordTemplate: unfiled$public/CommunityForgotPasswordEmailTemplate
165
- gatherCustomerSentimentData: false
166
- headlessForgotPasswordTemplate: unfiled$public/CommunityHeadlessForgotPasswordTemplate
167
- headlessRegistrationTemplate: unfiled$public/CommunityHeadlessRegistrationTemplate
168
- networkMemberGroups:
169
- - profile: admin
170
- networkPageOverrides:
171
- - changePasswordPageOverrideSetting: Standard
172
- - forgotPasswordPageOverrideSetting: Designer
173
- - homePageOverrideSetting: Designer
174
- - loginPageOverrideSetting: Designer
175
- - selfRegProfilePageOverrideSetting: Designer
176
- newSenderAddress: admin@company.com
177
- picassoSite: {siteName}1
178
- selfRegistration: false
179
- sendWelcomeEmail: true
180
- site: {siteName}
181
- siteArchiveStatus: NotArchived
182
- status: UnderConstruction
183
- tabs:
184
- - defaultTab: home
185
- - standardTab: Chatter
186
- urlPathPrefix: {siteUrlPathPrefix}vforcesite
187
- welcomeTemplate: unfiled$public/CommunityWelcomeEmailTemplate
188
- ```
189
-
190
- **CustomSite**:
191
-
192
- ```yaml
193
- active: true
194
- allowGuestPaymentsApi: false
195
- allowHomePage: false
196
- allowStandardAnswersPages: false
197
- allowStandardIdeasPages: false
198
- allowStandardLookups: false
199
- allowStandardPortalPages: true
200
- allowStandardSearch: false
201
- authorizationRequiredPage: CommunitiesLogin
202
- bandwidthExceededPage: BandwidthExceeded
203
- browserXssProtection: true
204
- cachePublicVisualforcePagesInProxyServers: true
205
- clickjackProtectionLevel: SameOriginOnly
206
- contentSniffingProtection: true
207
- enableAuraRequests: true
208
- fileNotFoundPage: FileNotFound
209
- genericErrorPage: Exception
210
- inMaintenancePage: InMaintenance
211
- indexPage: CommunitiesLanding
212
- masterLabel: {siteName}
213
- redirectToCustomDomain: false
214
- referrerPolicyOriginWhenCrossOrigin: true
215
- selfRegPage: CommunitiesSelfReg
216
- siteType: ChatterNetwork
217
- urlPathPrefix: {siteUrlPathPrefix}vforcesite
218
- ```
219
-
220
- ### Content Defaults
221
-
222
- apiNames and other metadata of site contents:
223
-
224
- **sfdc_cms__appPage**:
225
-
226
- - mainAppPage
227
-
228
- **sfdc_cms__brandingSet**:
229
-
230
- - Build_Your_Own_LWR
231
-
232
- **sfdc_cms__languageSettings**:
233
-
234
- - languages
235
-
236
- **sfdc_cms__mobilePublisherConfig**:
237
-
238
- - mobilePublisherConfig
239
-
240
- **sfdc_cms__theme**:
241
-
242
- - Build_Your_Own_LWR
243
-
244
- **sfdc_cms__route**:
245
-
246
- | Route | apiName | routeType | urlPrefix | urlName | viewId | configurationTags |
247
- |-------|---------|-----------|-----------|---------|--------|-------------------|
248
- | Home | Home | home | "" | home | home | |
249
- | Login | Login | login-main | login | login | login | |
250
- | Register | Register | self-register | SelfRegister | register | register | |
251
- | Forgot_Password | Forgot_Password | forgot-password | ForgotPassword | forgot-password | forgotPassword | |
252
- | Check_Password | Check_Password | check-password | CheckPasswordResetEmail | check-password | checkPasswordResetEmail | |
253
- | Error | Error | error | error | error | error | |
254
- | Service_Not_Available | Service_Not_Available | service-not-available | service-not-available | service-not-available | serviceNotAvailable | allow-in-static-site |
255
- | Too_Many_Requests | Too_Many_Requests | too-many-requests | too-many-requests | too-many-requests | tooManyRequests | too-many-requests, allow-in-static-site |
256
- | News_Detail__c | News_Detail__c | managed-content-sfdc_cms__news | news | news-detail | newsDetail | |
257
-
258
- **sfdc_cms__view**:
259
-
260
- | View | apiName | viewType | urlName | themeLayoutType |
261
- |------|---------|----------|---------|-----------------|
262
- | home | home | home | home | Inner |
263
- | login | login | login-main | login | Inner |
264
- | register | register | self-register | register | Inner |
265
- | forgotPassword | forgotPassword | forgot-password | forgot-password | Inner |
266
- | checkPasswordResetEmail | checkPasswordResetEmail | check-password | check-password | Inner |
267
- | error | error | error | error | Inner |
268
- | serviceNotAvailable | serviceNotAvailable | service-not-available | service-not-available | ServiceNotAvailable |
269
- | tooManyRequests | tooManyRequests | too-many-requests | too-many-requests | ServiceNotAvailable |
270
- | newsDetail | newsDetail | managed-content-sfdc_cms__news | news-detail | Inner |
271
-
272
- **sfdc_cms__site**:
273
-
274
- - {siteName}1
275
-
276
- **sfdc_cms__themeLayout**:
277
-
278
- - scopedHeaderAndFooter
279
- - snaThemeLayout
@@ -1,141 +0,0 @@
1
- # Content Type: sfdc_cms__brandingSet
2
-
3
- **Use when** user explicitly requests creating/updating branding set.
4
-
5
- ## Table of Contents
6
-
7
- - Core Principles
8
- - Generation Guidelines
9
- - Editing Existing Branding Sets
10
- - Branding Property Patterns
11
-
12
- ## Core Principles
13
-
14
- 1. **Purpose**: Manage site-wide branding properties (colors, fonts, etc.).
15
- 2. **Site Association**: Branding sets are linked to the site configuration.
16
-
17
- ## Generation Guidelines
18
-
19
- ### 1. Directory Structure
20
-
21
- 1. **Location**: `digitalExperiences/site/[SITE_NAME]/sfdc_cms__brandingSet/[BRANDING_SET_NAME]/`
22
- 2. **Required Files**:
23
- - `_meta.json` - Metadata file defining the API name and type
24
- - `content.json` - Content file defining the configuration and layout
25
- 3. **Naming Convention**: Underscore-separated names (e.g., `Branding_Set`).
26
-
27
- ### 2. _meta.json Structure
28
-
29
- The `_meta.json` file must contain:
30
-
31
- ```json
32
- {
33
- "apiName": "[BRANDING_SET_NAME]",
34
- "type": "sfdc_cms__brandingSet",
35
- "path": "brandingSets"
36
- }
37
- ```
38
-
39
- **Rules**:
40
-
41
- - `apiName`: Must match the directory name exactly (e.g., `Branding_Set`)
42
-
43
- ### 3. content.json Structure
44
-
45
- The `content.json` file must contain:
46
-
47
- ```json
48
- {
49
- "type": "sfdc_cms__brandingSet",
50
- "title": "[DISPLAY_TITLE]",
51
- "contentBody": {},
52
- "urlName": "[URL_NAME]"
53
- }
54
- ```
55
-
56
- **Field Definitions**:
57
-
58
- - `type`: **Required**. Represents the content type. The only supported value is `"sfdc_cms__brandingSet"`.
59
- - `title`: **Required**. Human-readable display title (e.g., Branding Set).
60
- - Maximum length is **100 characters**.
61
- - Must be **unique** within the space's brandingSet content items.
62
- - `contentBody`: Include all `required` properties from `schemaDefinition`.
63
- 1. **Seed**: Always call `execute_metadata_action` with `shouldIncludeExamples: true`. Copy the *entire* example object from `examplesOfContentType[0]` into `content.json`. **NEVER** start from a minimal stub.
64
- 2. **Recalculate (CRITICAL STOP)**: You MUST stop and perform explicit changes for dependent tokens BEFORE generating JSON.
65
- - [] Refer to "Branding Property Patterns" for detailed calculations.
66
-
67
- - `brandingSetType`: Represents whether the color palette is for the entire site or a specific section.
68
- - `APP`: The branding set applies to the entire site. There can be only one branding set of this type.
69
- - `SCOPED`: A `SCOPED` branding set can be applied only to a section component for granular overrides.
70
- - `definitionName`: **Required**. Represents the name for the branding set used in the site or template’s theme.
71
- - **Build Your Own (LWR)**: uses `talon-template-byo:branding`
72
- - **Microsite**: uses `microsite-template-marketing:branding`
73
- - `values`: **Required**. Represents a map (object) of branding values (colors, fonts, etc.) that can be applied to a site.
74
- - **Format**: An object containing key-value pairs that represent branding-set values.
75
- - **Patterns**: See the "Branding Property Patterns" section for details on value relationships.
76
- - `urlName`: Lowercase with hyphens (e.g., `branding-set`)
77
-
78
- ### 4. Naming Conventions Summary
79
-
80
- | Field | Format | Example |
81
- |-------|--------|--------|
82
- | Directory/apiName | Underscore-separated | `Branding_Set` |
83
- | title | Human-readable | `Branding Set` |
84
- | urlName | Lowercase-hyphens | `build-your-own-lwr` |
85
-
86
- ### 5. Generation Checklist
87
-
88
- - [ ] Directory and `_meta.json` follow naming conventions
89
- - [ ] `content.json` has all required fields
90
- - [ ] `contentBody` follows the schema provided by `execute_metadata_action`
91
- - [ ] **STOP AND VERIFY**: `contentBody.values` honors all **Branding Property Patterns** defined below and explicitly recalculated and updated all dependent tokens based on any token updates requested by the user.
92
-
93
- ## Editing Existing Branding Sets
94
-
95
- Use this section when modifying existing branding sets under the `sfdc_cms__brandingSet` directory.
96
-
97
- ### Editing Checklist
98
-
99
- - [ ] Ensure all modified branding properties honor the **Branding Property Patterns** defined below.
100
-
101
- ## Branding Property Patterns
102
-
103
- When generating or validating `contentBody.values`, follow these established patterns for consistency:
104
-
105
- ### 1. Color Scaling Patterns (The "Rule of 3")
106
-
107
- Salesforce uses a numeric suffix system (`Color`, `Color1`, `Color2`, `Color3`) to create a tonal palette.
108
-
109
- - **Darkening Trend**: As the suffix number increases, the color becomes progressively darker.
110
- - Example: `BackgroundColor` (#ffffff) → `_BackgroundColor1` (#ebebeb) → `_BackgroundColor2` (#c2c2c2) → `_BackgroundColor3` (#858585).
111
- - **Contrast/Foreground Colors**: Every base color has a corresponding `ForegroundColor` to ensure accessibility.
112
- - **WCAG Compliance**: Ensure a color contrast ratio of at least **4.5:1** between the background and foreground colors for standard text.
113
- - Dark base colors usually have white (#ffffff) foregrounds.
114
- - Light base colors (like `_NeutralColor`) usually have black (#000000) foregrounds.
115
-
116
- ### 2. Font Size Hierarchy
117
-
118
- - **Base vs. Small**: The `Small` variant is typically **75%** of the base size.
119
- - Example: `BodyFontSize` (1rem) → `BodySmallFontSize` (0.75rem).
120
- - **Heading Scale**: Headings follow a standard typographic scale:
121
- - `HeadingExtraLarge`: 2.5rem
122
- - `HeadingLarge`: 1.75rem (~70% of XL)
123
- - `HeadingMedium`: 1.25rem (~50% of XL)
124
- - `HeadingSmall`: 1.125rem
125
-
126
- ### 3. Design Token Mapping
127
-
128
- Prefer using **DXP Design Tokens** over hardcoded values where possible:
129
-
130
- - **Fonts**: Use `var(--dxp-s-html-font-family)` for base, body, and button fonts.
131
- - **Brand Alignment**: Use `var(--dxp-g-brand)` for primary brand colors and links.
132
-
133
- ### 4. Component Consistency
134
-
135
- - **Buttons**: Maintain consistent `BorderRadius` (e.g., 4px) across all button sizes (Small, Medium, Large).
136
- - **Form Elements**: `FormElementLabelFontSize` and `FormElementTextFontSize` should match.
137
-
138
- ### 5. Spacing and Ratios
139
-
140
- - **Device Ratios**: Desktop spacing (padding/spacers) is typically **1.33x** larger than mobile spacing.
141
- - Example: `ColumnSpacerSizeDesktop` (1rem) vs `ColumnSpacerSizeMobile` (0.75rem).
@@ -1,232 +0,0 @@
1
- # Content Type: sfdc_cms__route
2
-
3
- **Use when** user explicitly requests creating a new page. Not for editing existing routes.
4
-
5
- ## Table of Contents
6
-
7
- - Generation Guidelines
8
- - Core Principles
9
- - Directory Structure (All Routes)
10
- - _meta.json Structure
11
- - Part A: CUSTOM PAGES
12
- - Part B: OBJECT PAGES
13
-
14
- ## Generation Guidelines
15
-
16
- **PAGE TYPES**: These guidelines supports two types of pages:
17
-
18
- 1. **Custom Pages** - Single route pages for custom content (e.g., About Us). **Note**: Standard pages (e.g., Home, Login) come pre-built with the site and cannot be created.
19
- 2. **Object Pages** - Requires 3 routes: Detail, List, and Related List (e.g., Account, custom objects)
20
-
21
- ## Core Principles
22
-
23
- 1. **Purpose**: Generate new routes under the `sfdc_cms__route` directory.
24
- 2. **View Association**: Each route must reference a corresponding view in the `sfdc_cms__view` directory.
25
- 3. **CRITICAL**: The `routeType` in the route's `content.json` MUST exactly match the `viewType` in the corresponding view's `content.json`. This is a required validation rule.
26
-
27
- ## Directory Structure (All Routes)
28
-
29
- 1. **Location**: `digitalExperiences/site/[SITE_NAME]/sfdc_cms__route/[ROUTE_NAME]/`
30
- 2. **Required Files**:
31
- - `_meta.json` - Metadata file defining the API name and type
32
- - `content.json` - Content file defining the configuration and layout
33
- 3. **Naming Convention**: Underscore-separated names with "__c" suffix (About_Us__c, Account_Detail__c)
34
-
35
- ## _meta.json Structure (All Routes)
36
-
37
- The `_meta.json` file must contain:
38
-
39
- ```json
40
- {
41
- "apiName": "[ROUTE_NAME]",
42
- "type": "sfdc_cms__route",
43
- "path": "routes"
44
- }
45
- ```
46
-
47
- **Rules**:
48
-
49
- - `apiName`: Must match the route directory name exactly
50
- - `type`: Always `"sfdc_cms__route"`
51
- - `path`: Always `"routes"`
52
-
53
- ## Part A: CUSTOM PAGES
54
-
55
- Use this section when creating single-route custom content pages.
56
-
57
- ### A.1. content.json Structure
58
-
59
- The `content.json` file must contain:
60
-
61
- ```json
62
- {
63
- "type": "sfdc_cms__route",
64
- "title": "[DISPLAY_TITLE]",
65
- "contentBody": {},
66
- "urlName": "[URL_NAME]"
67
- }
68
- ```
69
-
70
- **Field Definitions**:
71
-
72
- - `type`: Always `"sfdc_cms__route"`
73
- - `title`: Human-readable display title (e.g., About Us)
74
- - `contentBody`: Include all `required` properties from `schemaDefinition`. Use `examplesOfContentType` for reference.
75
- - `urlName`: URL identifier (lowercase with hyphens, e.g., `about-us`)
76
-
77
- ### A.2. Naming Conventions
78
-
79
- For a page named "About Us":
80
-
81
- | Field | Format | Example |
82
- |-------|--------|--------|
83
- | Directory Name | Underscore-separated + "__c" | `About_Us__c` |
84
- | apiName | Same as directory | `About_Us__c` |
85
- | title | Human-readable | `About Us` |
86
- | contentBody.activeViewId | Underscore-separated (no __c) | `About_Us` |
87
- | contentBody.routeType | "custom-" + lowercase hyphens | `custom-about-us` |
88
- | contentBody.urlPrefix | Lowercase hyphens | `about-us` |
89
- | urlName | Lowercase hyphens | `about-us` |
90
-
91
- **CRITICAL**: `routeType` MUST exactly match `viewType` in the corresponding view's `content.json`.
92
-
93
- ### A.3. View Dependency
94
-
95
- - Before creating a route, ensure the corresponding view exists in `sfdc_cms__view/[view_name]/`
96
- - If the view doesn't exist, create it first following the view creation guidelines
97
-
98
- ### A.4. Generation Checklist
99
-
100
- - [ ] Route directory and files created (see Directory Structure)
101
- - [ ] `_meta.json` follows structure (see _meta.json Structure)
102
- - [ ] `content.json` follows structure (see A.1)
103
- - [ ] All naming conventions applied (see A.2)
104
- - [ ] Corresponding view exists (see A.3)
105
-
106
- ## Part B: OBJECT PAGES
107
-
108
- Use this section when creating object pages that require Detail, List, and Related List routes.
109
-
110
- ### B.1. Overview
111
-
112
- Object pages require **three routes** to be created together:
113
-
114
- 1. **Detail Route** - Displays a single record
115
- 2. **List Route** - Displays a list of records
116
- 3. **Related List Route** - Displays related records for a parent record
117
-
118
- **OBJECT TYPES**: Two types of Salesforce objects use different `routeType` formats:
119
-
120
- | Object Type | routeType Format | Example |
121
- |-------------|------------------|----------|
122
- | **Standard** (Account, Contact) | `[type]-[keyPrefix]` | `detail-001`, `list-001`, `relatedlist-001` |
123
- | **Custom** (Test_Object__c) | `[type]-[ObjectApiName]` | `detail-Test_Object__c`, `list-Test_Object__c` |
124
-
125
- - **keyPrefix**: 3-character identifier unique to each standard object (Account=001, Contact=003)
126
- - **ObjectApiName**: Custom object API name including the "__c" suffix
127
-
128
- Obtain object information from the `objectList` MCP output:
129
-
130
- ```json
131
- [
132
- ["Label", "ApiName", "KeyPrefix", "IsCustom"]
133
- ]
134
- ```
135
-
136
- ### B.2. Required Routes
137
-
138
- Create three directories under `sfdc_cms__route/`:
139
-
140
- - `[OBJECT_NAME]_Detail__c/`
141
- - `[OBJECT_NAME]_List__c/`
142
- - `[OBJECT_NAME]_Related_List__c/`
143
-
144
- ### B.3. content.json Structure
145
-
146
- Each route's `content.json` file must contain:
147
-
148
- ```json
149
- {
150
- "type": "sfdc_cms__route",
151
- "title": "[OBJECT_NAME] [TYPE]",
152
- "contentBody": {},
153
- "urlName": "[object_name_lowercase]-[type]"
154
- }
155
- ```
156
-
157
- **Field Definitions**:
158
-
159
- - `type`: Always `"sfdc_cms__route"`
160
- - `title`: Human-readable title (Account Detail, Account List)
161
- - `contentBody`: Include all `required` properties from `schemaDefinition`. Use `examplesOfContentType` for reference.
162
- - `contentBody.urlPrefix`: **CRITICAL**: Must be identical across all three object page views (Detail, List, and Related List) for the same object.
163
- - `urlName`: Lowercase with hyphens (account-detail, account-list)
164
-
165
- ### B.4. Object Page Examples
166
-
167
- Use `[ObjectName]` as the object name (Account, Test_Object) and `[IDENTIFIER]` as:
168
-
169
- - **Standard objects**: keyPrefix (001 for Account, 003 for Contact)
170
- - **Custom objects**: ObjectApiName (Test_Object__c)
171
-
172
- #### content.json Template
173
-
174
- ```json
175
- {
176
- "type": "sfdc_cms__route",
177
- "title": "[ObjectName] [Detail|List|Related List]",
178
- "contentBody": {
179
- "activeViewId": "[ObjectName]_[Detail|List|Related_List]",
180
- "configurationTags": [],
181
- "pageAccess": "UseParent",
182
- "routeType": "[detail|list|relatedlist]-[IDENTIFIER]",
183
- "urlPrefix": "[object-name-lowercase]"
184
- },
185
- "urlName": "[object-name-lowercase]-[detail|list|related-list]"
186
- }
187
- ```
188
-
189
- **Rules**:
190
-
191
- - Before any actions, *always* call `execute_metadata_action` to get the full schema and examples per the skill document.
192
-
193
- #### routeType Examples
194
-
195
- | Route Type | Standard (Account) | Custom (Test_Object__c) |
196
- |------------|-------------------|------------------------|
197
- | Detail | `detail-001` | `detail-Test_Object__c` |
198
- | List | `list-001` | `list-Test_Object__c` |
199
- | Related List | `relatedlist-001` | `relatedlist-Test_Object__c` |
200
-
201
- ### B.5. Naming Conventions
202
-
203
- For an object named "Account":
204
-
205
- | Field | Detail | List | Related List |
206
- |-------|--------|------|---------------|
207
- | Directory Name | `Account_Detail__c` | `Account_List__c` | `Account_Related_List__c` |
208
- | apiName | `Account_Detail__c` | `Account_List__c` | `Account_Related_List__c` |
209
- | title | `Account Detail` | `Account List` | `Account Related List` |
210
- | activeViewId | `Account_Detail` | `Account_List` | `Account_Related_List` |
211
- | routeType (Standard) | `detail-[keyPrefix]` | `list-[keyPrefix]` | `relatedlist-[keyPrefix]` |
212
- | routeType (Custom) | `detail-[ObjectApiName]` | `list-[ObjectApiName]` | `relatedlist-[ObjectApiName]` |
213
- | urlPrefix | `account` | `account` | `account` |
214
- | urlName | `account-detail` | `account-list` | `account-related-list` |
215
-
216
- **CRITICAL**: `routeType` MUST exactly match `viewType` in the corresponding view's `content.json`.
217
-
218
- ### B.6. View Dependency
219
-
220
- - Before creating routes, ensure corresponding views exist in `sfdc_cms__view/`:
221
- - `[ObjectName]_Detail/`, `[ObjectName]_List/`, `[ObjectName]_Related_List/`
222
- - `activeViewId` must match the view directory name exactly
223
- - `routeType` must exactly match `viewType` in the corresponding view
224
- - If views don't exist, create them first following the view creation guidelines
225
-
226
- ### B.7. Generation Checklist
227
-
228
- - [ ] Object type determined (Standard or Custom) and identifier obtained (keyPrefix or ObjectApiName)
229
- - [ ] All three routes created: **Detail**, **List**, and **Related List**, each with `_meta.json` and `content.json`
230
- - [ ] All naming conventions applied (see B.5)
231
- - [ ] Corresponding views exist (see B.6)
232
- - [ ] `routeType` matches `viewType` for all three routes