# Owner portal

https://docs.kleaver.ie/modules/owner-portal/

A site owner can sign in and change the data behind their own site without touching HTML. **The portal mirrors the site:** it offers an editor for a module only if the site actually shows that module. A site with no price list has no price editor. Each editable module has one *schema* (site/schemas/<module>.json) that says what the owner may change and the limits; the same schema checks the data when the site is built, builds the portal's form, and writes the tables below. Text typed straight into a page stays with Kleaver, unless it is a *phrase slot* (a headline the owner may change).

### Opening hours

| Field | What it is for | Required | Limits |
| --- | --- | --- | --- |
| Days | Pick every day this row covers. | Yes | one or more days, each at most once |
| Closed on these days |  | No | on or off |
| Opens |  | Yes | HH:MM, 24-hour |
| Closes | Use 24:00 for midnight. | Yes | HH:MM, 24-hour (24:00 allowed) |
| Note (optional) | For example: drop-off by arrangement. | No | up to 60 characters |

### FAQ

| Field | What it is for | Required | Limits |
| --- | --- | --- | --- |
| Question |  | Yes | 5 to 140 characters |
| Answer | Leave a blank line to start a new paragraph. | Yes | 5 to 1200 characters |

### Headline words

The words are the owner's; the look (effect, hold, pace, loops, and the full stop or comma that follows) stays with Kleaver, in client.json under slots. One word renders as plain text with no animation; two or more take turns. Put {{slot.hero-words}} in the page.

| Field | What it is for | Required | Limits |
| --- | --- | --- | --- |
| Word or phrase | Up to 24 characters, without a full stop or comma at the end. | Yes | 1 to 24 characters |

### Contact details

The phone number and email address, shown wherever the site shows them. Type the tokens {{business.phoneDisplay}}, {{business.phoneHref}} (a tel: link; an Irish leading 0 becomes +353), {{business.email}} and {{business.emailHref}} in a page, or inside the footer and nav strings of client.json (one level only, never recursively; any other token there is left as typed and reported). The JSON-LD and llms.txt read the same values. Address and map position stay with Kleaver. **Both fields are sensitive:** publishing a change to either needs a fresh 6 digit code emailed to the signed-in owner (valid 10 minutes, five tries, void if anything else in the draft changes). Staff need no code; it is recorded.

| Field | What it is for | Required | Limits |
| --- | --- | --- | --- |
| Phone number | Type it the way you want customers to read it. | Yes | 0 |
| Email address | Customers can email you here. | Yes | 0 |

### The live preview

The editor shows the owner's real page next to the form. On each production build the site posts, for every page, a *template*: the page with a marker where each editable module draws its content. The portal fills the markers with the owner's draft using the same renderers the build uses (scripts/render/, copied to site/scripts/portal-render.js by scripts/gen-portal-render.mjs), inside a frame that cannot run scripts. A module is previewable as soon as it has a renderer here; nothing else is needed in the site. Parts of the page Kleaver looks after are listed too, dimmed, with an *Ask us to change this* button. To label a part yourself, add data-kleaver-label="Our team" to its section.

### Making a module portal-ready

1. Write its schema in site/schemas/, with plain-English labels and help (no technical words).
2. Make its renderer produce exactly the markup the page has today, and prove it with a snapshot comparison.
3. Replace any hand-typed copy of the same facts with tokens, so the site never says the same thing from two places.
4. Add its documentation here with {{schema.<id>}}.
5. Add its renderer to scripts/render/ and scripts/gen-portal-render.mjs, so the preview can draw it.

## Catalog

Owner-editable modules (schemas)  ·  see **`modules.html#owner-portal`**

The owner portal lets a site owner change the data behind a module. **The portal mirrors the site**: a module appears in a site's portal only if a visible token renders it on that site (data that only feeds JSON-LD or `llms.txt` does not count). Each editable module is one schema in `site/schemas/<id>.json`:

| Part | Meaning |
|---|---|
| `id`, `version`, `title`, `help` | Name and plain-English description (never technical words; checked) |
| `bind` | Where the data lives in `client.json` (`business.hours`); `slots.{instance}.words` for instanced modules |
| `tokens` | Tokens that show it; any one on a page makes the module present (`slot.*` matches instances) |
| `shape` | `list` (rows, or single values via `item.field`), `group`, or `value`, with `min`/`max` |
| fields | `type` (`text`, `longtext`, `number`, `money`, `time`, `days`, `select`, `toggle`, `url`, `phone`, `email`, `multiselect`, `date`, `lines` (a short list typed one per line; `max` per line, `maxItems`)), `label`, `help`, `required`, limits, `hidden` for Kleaver-owned fields |
| `rules`, `normalize` | Named cross-field checks and a tidy-up step (`scripts/content/rules.mjs`, `normalize.mjs`) |

Modules so far: **hours**, **faq**, **phrases** (headline words), **contact** (phone and email), **chrome** (per-page switches for the menu and footer), **checklist** (`{{checklist.items}}`: 1 to 8 icon-led points, the icon chosen by name from a fixed list), **classes** (`{{classes.cards}}`: the slides of a class-types carousel, one can be featured; the page keeps the `.carousel` wrapper and its buttons), **menu** (`{{menu.sections}}`: sections of dishes with allergens, dietary tags and an "available today" switch; the allergen design, the dietary-claim checks and the publish confirmation are in the design note `2026-12-03-menu-and-price-list-design.md`; Kleaver's own wording in `client.json` `menuLook`), **gallery** (`{{gallery.items}}`: photos with a required description and an optional caption; the portal resizes each in the owner's browser to 480/800/1200 px, the server checks it by its bytes and strips metadata, the build ships only the photos the content names; an account holds 40 photos by default, a staff-set account setting), **team** (`{{team.cards}}`: name, role, a line each; the avatar's initials are worked out, never typed), **timetable** (`{{timetable.week}}`: a flat list of classes, each a day, a start time, a name and a highlight; drawn grouped by day, Monday first, each day by time, empty days left out), **plans** (pricing cards: `{{plans.cards}}`; `{{plan.<id>.price|priceExact|name}}` for the site's own text, `featured` meaning the highlighted plan; Kleaver's look in `client.json` `pricing`: `href`, `label`, `featuredLabel`; the currency is one site-wide setting, `site.currency` (three-letter code, default `EUR`: plans, price lists, JSON-LD and `llms.txt` all follow it; an offer may still name its own); a site with plans derives `business.offers` from them; a plan the site's text points at cannot be removed). Owner text is stored raw and escaped at every output. `portal.json` in a site folder marks it portal-enabled (its content comes from the portal or `KLEAVER_CONTENT_FILE`); `content.seed.json` holds its starting content (`node scripts/seed-content.mjs demo/<site> --write`). Neither file is ever published.
