# cms-edit — Page Field Reference

A `page` entry is the root of a web page's content tree. It has a slug, metadata, and arrays of content components.

---

## Top-Level Fields

| Field | Type | Required | Description |
|---|---|---|---|
| `slug` | Text | Yes | URL slug without leading or trailing slash. Example: `part1/part2/part3`. Use `index` for the home page. |
| `title` | Text | Yes | Page title used in `<title>` and headings |
| `description` | Text | No | SEO meta description |
| `cmsLabel` | Text | No | Label shown in Contentful's entry list. Defaults to `title` |
| `indexed` | Boolean | No | Whether the page is indexed by search engines |
| `hidden` | Boolean | No | Whether the page is excluded from the sitemap |
| `template` | Link (Entry) | No | Link to a `template` entry for shared layout slots |
| `featuredImage` | Link (Asset) | No | Featured image asset for social sharing |

---

## Content Arrays

A page has three content slot arrays. Components are rendered in order within each slot.

| Field | Type | Description |
|---|---|---|
| `topContent` | Array of Links | Content rendered above the main content area (e.g. sticky nav, announcement bar) |
| `content` | Array of Links | Main content area. **Default target for `add` and `create from-json`** |
| `bottomContent` | Array of Links | Content rendered below the main content area (e.g. newsletter signup) |

Each array entry is a link to a `component`, `collection`, or `externalComponent` entry.

---

## Reading Page Fields

```bash
cms-edit open --page-slug /solutions
cms-edit read @c0           # read all fields on the page entry
cms-edit read @c0 title     # read just the title
cms-edit read @c0 slug
```

---

## Setting Page Fields

```bash
cms-edit set @c0 title "New Title"
cms-edit set @c0 description "Updated SEO description."
cms-edit set @c0 indexed true
cms-edit set @c0 hidden false
```

---

## Linking a Template

To link a template to a page, use the template entry ID:

```bash
cms-edit set @c0 template --link <templateEntryId>
```

Or in `create from-json`:
```json
{
  "slug": "/new-page",
  "title": "New Page",
  "templateId": "<templateEntryId>"
}
```

Find template IDs with:
```bash
cms-edit list --type template
```

---

## Adding Content to a Page

```bash
# Add a new component to the default content array
cms-edit add HeroSimple component

# Add to topContent
cms-edit add AnnouncementBar component --target topContent

# Add to bottomContent
cms-edit add NewsletterSignup component --target bottomContent

# Insert after a specific entry
cms-edit add TextBlock component --after @c3
```

---

## In create from-json

```json
{
  "type": "page",
  "slug": "/solutions/hepatology",
  "title": "Hepatology Solutions",
  "description": "Evidence generation for hepatology research.",
  "cmsLabel": "Hepatology Solutions Page",
  "templateId": "optionalTemplateId",
  "featuredImage": "<asset-id>",
  "featuredImageAssetFilename": "social-share.jpg",
  "indexed": true,
  "hidden": false,
  "components": [
    {
      "contentType": "component",
      "type": "HeroSimple",
      "target": "content",
      "fields": { "heading": "Hepatology Solutions" }
    }
  ]
}
```
