# Section types: what a page's sections hold

> The standard section types every project starts with, each field's key, kind and whether it is required, and how an empty field arrives.

A page from `GET /api/v1/content/pages/{slug}` is a list of sections, in the
owner's order. Each one is `{ "type": ..., ...fields }`: its section type's key,
and every field that type has. Every new project starts with the
10 standard types below, and the owner can change
them on the project's content schema screen, so treat this as where a project
starts rather than a contract: a section of a type your site has no component for
is best skipped.

## How each kind of field arrives

A field the owner left empty still arrives, as its kind's empty value, so a
component never has to check whether a key is there.

| Kind | Arrives as | Empty |
|---|---|---|
| Text | one line of text | `""` |
| Paragraph | a paragraph, newlines kept | `""` |
| List of lines | a list of strings, one per line in the editor | `[]` |
| Link | an object with "label" and "href" | `{"label": "", "href": ""}` |
| True or false | true or false | `false` |
| Repeatable group | a repeatable group of fields, one level deep | `[]` |
| Image | an image from the library: {id, url, width, height, alt}, or null when none is chosen | `null` |

A required field is never empty on a published page: the editor will not save
one. An image is read from the website's library each time a page is asked
for, so a new alt text arrives with the next answer, and an image deleted since
arrives as `null`.

## Writing pages from your server

A secret key can write pages too, under `/api/v1/content/drafts`, as the editor
does: a draft is checked against the schema (`GET /api/v1/content/schema`) when
it is saved, and visitors see nothing until it is published. An image field
takes the `id` of an image in the website's library, listed by
`GET /api/v1/images`, or the object a read gave. A test key writes drafts alone. Publishing, unpublishing and moving a page that is on the website
need a live key.

The section types themselves are shaped under `/api/v1/content/section-types`,
with either key, since a published page is served as it was published. A key is
permanent once made, a type is made with its fields or not at all, and a type a
page holds cannot be removed. Your site shows a new type only once it renders
that key.

## Hero: `hero`

The opening of a page. One per page is plenty. At most 1 on a page.

| Field | Kind | Required | In the editor |
|---|---|---|---|
| `eyebrow` | Text |  | Eyebrow |
| `headingLead` | Text | yes | Headline, first half |
| `headingAccent` | Text | yes | Headline, accent half: Rendered in the accent colour, so keep it short. |
| `body` | Paragraph | yes | Body |
| `trust` | List of lines |  | Trust points: One per line. |
| `ctaPrimary` | Link | yes | Primary call to action |
| `ctaSecondary` | Link |  | Secondary call to action |

## Text: `text`

A heading and prose: an about page, a policy, a note. 

| Field | Kind | Required | In the editor |
|---|---|---|---|
| `heading` | Text |  | Heading |
| `body` | Paragraph | yes | Body |

## Services: `services`



| Field | Kind | Required | In the editor |
|---|---|---|---|
| `heading` | Text | yes | Heading |
| `intro` | Paragraph |  | Intro |
| `items` | Repeatable group | yes | Services |

Each row of `items`:

| Field | Kind | Required | In the editor |
|---|---|---|---|
| `title` | Text | yes | Title |
| `body` | Paragraph | yes | Description |
| `link` | Link |  | Link |
| `points` | List of lines |  | What is included: One per line. |
| `featured` | True or false |  | Highlight this service |

## How it works: `steps`

Numbered by the frontend, in the order you arrange them. 

| Field | Kind | Required | In the editor |
|---|---|---|---|
| `heading` | Text | yes | Heading |
| `intro` | Paragraph |  | Intro |
| `items` | Repeatable group | yes | Steps |

Each row of `items`:

| Field | Kind | Required | In the editor |
|---|---|---|---|
| `title` | Text | yes | Title |
| `body` | Paragraph | yes | Description |

## Figures: `stats`



| Field | Kind | Required | In the editor |
|---|---|---|---|
| `heading` | Text |  | Heading |
| `items` | Repeatable group | yes | Figures |

Each row of `items`:

| Field | Kind | Required | In the editor |
|---|---|---|---|
| `value` | Text | yes | Figure |
| `label` | Text | yes | Caption |

## Testimonials: `testimonials`



| Field | Kind | Required | In the editor |
|---|---|---|---|
| `heading` | Text |  | Heading |
| `items` | Repeatable group | yes | Testimonials |

Each row of `items`:

| Field | Kind | Required | In the editor |
|---|---|---|---|
| `quote` | Paragraph | yes | Quote |
| `author` | Text | yes | Name |
| `role` | Text |  | Role |
| `company` | Text |  | Company |

## Pricing: `pricing`

Prices are text, so 'from CHF 4,900' and 'on request' both work. 

| Field | Kind | Required | In the editor |
|---|---|---|---|
| `heading` | Text | yes | Heading |
| `intro` | Paragraph |  | Intro |
| `note` | Text |  | Footnote: VAT, terms, small print. |
| `items` | Repeatable group | yes | Plans |

Each row of `items`:

| Field | Kind | Required | In the editor |
|---|---|---|---|
| `name` | Text | yes | Name |
| `price` | Text | yes | Price |
| `period` | Text |  | Period: per month, one-off |
| `description` | Paragraph |  | Description |
| `features` | List of lines |  | What is included: One per line. |
| `cta` | Link |  | Call to action |
| `featured` | True or false |  | Highlight this plan |
| `badge` | Text |  | Badge: 'Most booked', 'New'. Shown above the name. |

## FAQ: `faq`



| Field | Kind | Required | In the editor |
|---|---|---|---|
| `heading` | Text | yes | Heading |
| `intro` | Paragraph |  | Intro |
| `items` | Repeatable group | yes | Questions |

Each row of `items`:

| Field | Kind | Required | In the editor |
|---|---|---|---|
| `question` | Text | yes | Question |
| `answer` | Paragraph | yes | Answer |

## Call to action: `cta`

The closing ask at the end of a page. 

| Field | Kind | Required | In the editor |
|---|---|---|---|
| `heading` | Text | yes | Heading |
| `body` | Paragraph |  | Body |
| `ctaPrimary` | Link | yes | Primary call to action |
| `ctaSecondary` | Link |  | Secondary call to action |

## Contact: `contact`



| Field | Kind | Required | In the editor |
|---|---|---|---|
| `heading` | Text | yes | Heading |
| `body` | Paragraph |  | Body |
| `email` | Text |  | Email address |
| `phone` | Text |  | Phone number |
| `address` | Paragraph |  | Address |
| `cta` | Link |  | Call to action |
