-`_meta.json` - Metadata file defining the API name and type
-`content.json` - Content file defining the configuration and layout
## Purpose A: Generate New Theme Layouts
**IMPORTANT**: These guidelines should ONLY be applied when the user explicitly requests creating a new layout for their site. Do not apply these guidelines automatically for other tasks or when editing existing layouts.
### _meta.json Structure
The `_meta.json` file must contain:
```json
{
"apiName": "[THEME_LAYOUT_NAME]",
"type": "sfdc_cms__themeLayout",
"path": "themeLayouts"
}
```
**Rules**:
-`apiName`: Must match the themeLayout directory name exactly
-`type`: Always `"sfdc_cms__themeLayout"`
-`path`: Always `"themeLayouts"`
### content.json Structure
The `content.json` file must contain:
```json
{
"type": "sfdc_cms__themeLayout",
"title": "[DISPLAY_TITLE]",
"contentBody": {
"component": {
"attributes": { },
"children": [ "[regions in the layout]" ],
"definition": "[FQN of root layout component]",
"id": "[root component id]",
"type": "component"
}
},
"urlName": "[url name]"
}
```
**Field Definitions**:
-`type`: Always `"sfdc_cms__themeLayout"`
-`title`: Human-readable display title, words separated by spaces (e.g. "Scoped Header and Footer")
-`contentBody`: Include all `required` properties from `schemaDefinition`. Use `examplesOfContentType` for reference.
- Do not add additional fields.
-`urlName`: URL identifier (lowercase, words separated by dashes e.g., "scoped-header-and-footer")
**Lookup**: To find the theme content.json for the current site:
1. Navigate up from the current theme layout directory to the site directory.
2. Look in sfdc_cms__theme/ (sibling directory to sfdc_cms__themeLayout/).
3. Find the theme directory (typically one per site).
4. Read the file: content.json.
**Action (append-only)**:
- ALWAYS append a new entry to `contentBody.layouts`.
- Do NOT replace or remove existing `layouts` entries.
-`layoutId` MUST exactly match the new theme layout `apiName`.
-`layoutType` MUST be chosen based on intended view usage.
- **Default**: Generate a random 30-character alphanumeric string (e.g., `xEGgPxY5j5TForZe3J7SBguOfQicEy`) for the `layoutType`. Ensure this string is unique and does not match any existing `layoutType` in the list.
When adding, removing, or configuring components in existing theme layouts, **always** refer to [handle-ui-components.md](docs/handle-ui-components.md) for placement hierarchy, component structure, column layout, and property configuration.
**Note**: Theme layouts often define the overall structure (header/footer) surrounding the main content region. Ensure components are added to the correct region (e.g., `header`, `footer`).