# Modeling content

The five things you register, what each one holds, and where it lives in your project. Read this once; the rest of the group takes them one at a time.

## Registration is the model

Smoodly has no schema screens. Each schema sits in a file beside the component that renders it, is paired with that view, and is listed once in `smoodly/config.ts`. From that one definition Smoodly derives the editor form, the entry in *Add section*, the TypeScript props and the checks it runs at publish.

Change a field in code and the form changes with it. Nothing an editor does changes the code: editors fill fields and arrange sections inside the limits you set.

## The five types

| Type | Registered with | What it is |
| --- | --- | --- |
| `Page type` | smoodly.page() | A page component. It declares zones and renders them among your own JSX. Editors pick one when they create a page. |
| `Section` | smoodly.section() | A full-width component editors place in a zone: a hero, a row of cards, a quote. |
| `Element` | smoodly.element() | A small component editors insert inside richtext: a callout, a call to action. |
| `Collection` | smoodly.collection() | A content type with a fixed shape and many entries: posts, people. An entry page, smoodly.entryPage(), renders one entry at its own URL. |
| `Global` | smoodly.global() | Content that exists once and appears on many pages: the header, the footer, contact details. |

The custom section is the sixth piece and is built in: rows of richtext columns editors lay out themselves, offered only where a zone allows it.

In the Lorem Co. starter that is nine sections, four page types, two entry pages, three collections, four globals and two elements. Page types, sections and elements live in `components/`, two files each: the schema and the view. Collections and globals are lists in `smoodly/collections.ts` and `smoodly/globals.ts`.

## How they nest

Containment is short and fixed:

```
Page type → zone → section
                 → custom section → rows → columns of richtext → elements
```

A section never holds another section. A section that needs columns builds them in code, and editors who need a free layout get the custom section. That cap is what keeps drag and drop, rendering and the canvas simple.

Around the zones, a page type renders whatever JSX you like: navigation, a grid of the newest posts, a form. That JSX shows in the canvas but is not selectable, so it stays yours.

## Content, settings and styles

Everything editors change is stored per page, in three groups:

- **Fields** are content: the heading, the photo, the list of buttons. They can be localized.
- **Settings** are the options you declare on a section for how it looks, like which side the image sits on. The view alone interprets them.
- **Styles** are Smoodly's own spacing, width and alignment steps, offered on every section unless you turn them off.

Editors see fields on the *Content* tab and the other two on the *Settings* tab.

## Reading order

1. [Sections](https://smoodly.io/docs/content-modeling/sections.md): a schema, a view, marks and registration.
2. [Page types](https://smoodly.io/docs/content-modeling/page-types.md): zones, fixed and open pages, the page prop.
3. [Zones and freedom](https://smoodly.io/docs/content-modeling/zones.md): the three zone policies.
4. [Settings, styles and CSS](https://smoodly.io/docs/content-modeling/styles-and-settings.md), [The custom section](https://smoodly.io/docs/content-modeling/custom-section.md) and [Marks and inline editing](https://smoodly.io/docs/content-modeling/marks.md).

Then [Fields](https://smoodly.io/docs/fields/overview.md) for every field type, and [Collections](https://smoodly.io/docs/collections/defining.md) and [Globals](https://smoodly.io/docs/globals/defining.md) for the two types that live outside pages.
