8.5 KiB
Content Type: sfdc_cms__view
Use when user explicitly requests creating a new page.
Table of Contents
- Purpose A: Generate New Views
- Purpose B: Editing Existing Views
Purpose A: Generate New Views
Generation Guidelines
PAGE TYPES: These guidelines supports two types of pages:
- Custom Pages - Single view 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.
- Object Pages - Requires 3 views: Detail, List, and Related List (e.g., Account, custom objects)
Core Principles
- Route Association: Views are referenced by routes via the
activeViewIdfield. - CRITICAL: The
viewTypeMUST exactly match therouteTypein the corresponding route.
Directory Structure (All Views)
- Location: Views must be created under:
digitalExperiences/site/[SITE_NAME]/sfdc_cms__view/[VIEW_NAME]/ - Required Files:
_meta.json- Metadata file defining the API name and typecontent.json- Content file defining the configuration and layout
- Naming Convention: Underscore-separated names, no "__c" suffix (About_Us, Account_Detail)
_meta.json Structure (All Views)
The _meta.json file must contain:
{
"apiName": "[VIEW_NAME]",
"type": "sfdc_cms__view",
"path": "views"
}
Rules:
apiName: Must match directory name exactly. No "__c" suffix.type: Always"sfdc_cms__view"path: Always"views"
Theme Layout Type (All Views)
The contentBody.themeLayoutType field specifies which theme layout to use for the view.
-
Default:
"Inner"- Use this default if the user does not specify a layout OR if the lookup fails to find a matching layoutType -
Lookup: To find valid values:
- Navigate up from the current view directory to the site directory
- Look in
sfdc_cms__theme/(sibling directory tosfdc_cms__view/) - Find the theme directory (typically one per site)
- Check
content.json→contentBody.layouts[]for the layouts array
-
Layout Name/ID Resolution: If the user provides only a layout name or ID (e.g., "scopedHeaderAndFooter"), you must look up the corresponding
layoutType:- Find the theme's
content.jsonas described above - Locate the
contentBody.layoutsarray containinglayoutId/layoutTypepairs - Match the user-provided name/ID against
layoutIdvalues - Use the corresponding
layoutTypevalue forcontentBody.themeLayoutType - Use ONLY the
layoutTypevalue forcontentBody.themeLayoutType- do NOT use the layoutId or user's provided name - If no match is found, use the default
"Inner"
- Find the theme's
PART A: CUSTOM PAGES
Use this section when creating single-view custom content pages.
A.1. content.json Structure
The content.json file must contain:
{
"type": "sfdc_cms__view",
"title": "[DISPLAY_TITLE]",
"contentBody": {},
"urlName": "[URL_NAME]"
}
Field Definitions:
type: Always"sfdc_cms__view"title: Human-readable display title (e.g., About Us)contentBody: Include allrequiredproperties fromschemaDefinition. UseexamplesOfContentTypefor reference.urlName: Lowercase with hyphens (e.g.,about-us)
A.2. Component Structure
MUST use community_layout:sldsFlexibleLayout as the root with exactly 2 regions (content and sfdcHiddenRegion), even if no components exist:
community_layout:sldsFlexibleLayout (root)
├── content (region) — main page content
└── sfdcHiddenRegion (region) — hidden region for SEO and metadata
CRITICAL REQUIREMENTS:
- Region names are fixed: The region
namefield MUST be exactlycontentorsfdcHiddenRegion. Do NOT invent custom region names. - sfdcHiddenRegion MUST contain seoAssistant: The
sfdcHiddenRegionregion MUST ALWAYS include acommunity_builder:seoAssistantcomponent in itschildrenarray. - Components live in children: All components are placed inside the
childrenarray of a region. Use an emptychildren: []array forcontentif no components exist.
Each region requires: id (unique UUID), name, title, type: "region", children. Do not add any other fields.
A.3. Naming Conventions Summary
| Field | Format | Example |
|---|---|---|
| Directory/apiName | Underscore-separated, no "__c" | About_Us |
| title | Human-readable | About Us |
| viewType | custom- + lowercase-hyphens |
custom-about-us |
| urlName | Lowercase-hyphens | about-us |
A.4. Route Dependency
The route's activeViewId must match the view's directory name exactly.
A.5. Generation Checklist
- Directory and
_meta.jsonfollow structure (see Directory Structure, _meta.json Structure) content.jsonhas all required fields (A.1)- Component structure correct with both regions (A.1)
- CRITICAL: Complete all the UUID generation steps per GR.4
viewTypematches route'srouteType(CRITICAL)
PART B: OBJECT PAGES
Use this section when creating object pages that require Detail, List, and Related List views.
B.1. Overview
Object pages require three views: Detail, List, and Related List. All share the same object name.
Object Types & viewType Format:
| Object Type | Identifier | viewType Example |
|---|---|---|
| Standard (Account, Contact) | keyPrefix (3-char) |
detail-001, list-001, relatedlist-001 |
| Custom (Test_Object__c) | API name with __c |
detail-Test_Object__c, list-Test_Object__c |
Obtain object information from the objectList output from sfdc_cms__route:
[
["Label", "ApiName", "KeyPrefix", "IsCustom"]
]
B.2. Required Views
Create three directories under sfdc_cms__view/:
[OBJECT_NAME]_Detail/[OBJECT_NAME]_List/[OBJECT_NAME]_Related_List/
B.3. content.json Structure
{
"type": "sfdc_cms__view",
"title": "[OBJECT_NAME] [TYPE]",
"contentBody": {
"component": {},
"dataProviders": [],
"themeLayoutType": "[THEME_LAYOUT_TYPE]",
"viewType": "[PREFIX]-[IDENTIFIER]"
},
"urlName": "[OBJECT_NAME_LOWERCASE]-[TYPE]"
}
Field Definitions:
type: Always"sfdc_cms__view"title: Human-readable (e.g., "Account Detail")contentBody: Include allrequiredproperties fromschemaDefinition. UseexamplesOfContentTypefor reference.contentBody.viewType: CRITICAL: Must exactly match route'srouteTypeurlName: Lowercase with hyphens (e.g.,account-detail)
B.4. Component Structure
Uses same structure as Part A.1 (Component Structure) with these SEO assistant differences:
- Detail View:
pageTitle: "{!Record._Object}: {!Record._Title}" - List/Related List Views:
recordId: "{!recordId}"(no pageTitle)
Default template includes one section with one empty column. seedComponents must be [] (not null).
B.5. Naming Conventions Summary
| Field | Detail | List | Related List |
|---|---|---|---|
| Directory/apiName | [Object]_Detail |
[Object]_List |
[Object]_Related_List |
| title | [Object] Detail |
[Object] List |
[Object] Related List |
| viewType (Standard) | detail-[keyPrefix] |
list-[keyPrefix] |
relatedlist-[keyPrefix] |
| viewType (Custom) | detail-[ApiName__c] |
list-[ApiName__c] |
relatedlist-[ApiName__c] |
| urlName | [object]-detail |
[object]-list |
[object]-related-list |
B.6. Route Dependency
The route's activeViewId must match the view's directory name exactly. The viewType must exactly match the route's routeType.
B.7. Generation Checklist
- Object type determined; identifier obtained (
keyPrefixor API name with__c) - All three views created: Detail, List, and Related List, each with
_meta.jsonandcontent.json viewTypematches route'srouteTypefor all three views (CRITICAL)- Component structure correct with both regions (see A.1)
- SEO assistant configured correctly per view type (B.4)
- CRITICAL: Complete both UUID generation steps per GR.4
Purpose B: Editing Existing Views
Use this section when modifying existing views under the sfdc_cms__view directory.
Component Modifications
When adding, removing, or configuring components in existing views, refer to the Component Insertion section for placement hierarchy, component structure, column layout, and property configuration.
Theme Layout Type
To change a view's theme layout, update contentBody.themeLayoutType in the view's content.json. See Theme Layout Type (All Views) for default and lookup details