<!-- Built by scripts/build-agent-docs.mjs from site/agents-src/templates.md: edit that file. -->
# Page Lemon templates: guide for AI assistants

> For people: https://pagelemon.com/docs/templates explains this feature in plain words. This page is for AI assistants.

Page Lemon has a gallery of ready-made site designs (templates): plain HTML, CSS and a little JavaScript with no build step, each about a fictional business. You turn one into the person's own site: their words, facts and photos, with a real form or booking page where the template has a place for one. Publishing in general: https://pagelemon.com/agents.

Use this when the person says "Use template pagelemon.com/tp/<Name>" (or the same in their language, or pastes a `pagelemon.com/tp/<Name>` link), "Build with PageLemon.com" or "Build with PageLemon.com: <what the site is for>". The description is the brief: it picks the template and answers part of the interview, so ask only for what it doesn't already say.

## Plans and limits

Templates are free on every plan, and a site made from one is an ordinary site. Site size and files depend on the plan (https://pagelemon.com/pricing); a form works on every plan, and online booking needs a paid plan (staff and rooms only on some).

- A template is small (each lists its `weightKB` in `index.json`), so the size and file limits are rarely a problem; photos the person adds count.
- A site published without an account goes offline after 72 hours unless the person keeps it with a free account: offer that (see https://pagelemon.com/agents "Keeping the site").
- A form needs a kept site with an account (https://pagelemon.com/agents/forms); booking needs a paid plan (https://pagelemon.com/agents/booking). Say first, before the interview, if the template's form or booking slot needs a plan the person doesn't have; until then the slot's fallback (a phone number, an email link or the person's own booking link) works. When the plan lacks the feature, the reply says so and gives `pricing_url` (on Free, with "Not for you? Cancel within 14 days of starting for a refund: in full the first time in 12 months, pro rata after that."): pass it on, don't retry.
- Say plan names, never ids.

## Ask the person

Fetch `https://pagelemon.com/templates/<slug>/template.json` and ask its `interview` questions, a few at a time, in plain words; `facts` lists everything to collect. Skip what their request already answered. If they can't answer one, remove that element rather than inventing it. In one message also ask:

- **Photos:** each `<img data-pl-photo="...">` says what picture belongs there. Ask for their photos, or keep the template's picture: some templates use free stock photos (Unsplash or Pexels licences, no credit needed), which show a sample business, so swap any that would mislead, such as a dish they don't serve. If they have photos on a phone or computer, give them an upload link (`site_make` `action=upload_link`).
- **A form or bookings?** Each slot in `template.json` `slots` has a `kind` (`form` or `booking`) and a `page`. Ask whether they want the real thing, and what it should ask or offer (the forms and booking guides have the questions: https://pagelemon.com/agents/forms, https://pagelemon.com/agents/booking).
- **Languages:** only if they want more than one (https://pagelemon.com/agents/languages).

If they haven't picked a template, map what they do to a category in `https://pagelemon.com/templates/index.json` (`jobs[].categories[]`: match `label`, `alsoFits` and each template's `audience`), offer up to 3 with their `direction` and `preview` link, and default to the first. Don't mix templates.

## What the person needs ready

Their business name, address, phone, email, opening hours and prices, and their own photos (the interview says which). Nothing is signed up for and no keys are needed. Real reviews only if they have them: never invent reviews, numbers or awards. If the site collects personal data (a form, a booking page), it needs a privacy notice: the template carries one (below).

## Set it up

1. **Get the files.** MCP: `site_publish` with `template: "<slug>"` and, for a new site, `name` (`workspace` too when the person has more than one). Page Lemon copies every file on its side; the reply has `site`, version `number`, `next_actions` and `guide_url`, and `site_token` without an account.
   Its canonical, `og:url` and JSON-LD `url` already point at the new site, and the sample `og.png` and `og:image` tags are left out; the fictional sample business is still there, so the site is live with it until you replace it: don't show the link until your edits are live. Without the connector, fetch every path in `files` from `https://pagelemon.com/template-files/<slug>/<path>` and save them with the same relative paths. Fetch nothing else.
2. **Make it theirs**, following `customise` in `template.json`: replace every `data-pl-fill` element (names, phone, email, address, hours, prices, people, dates, links) on every page and then remove the attributes, and the sample town, street and people's names in ordinary sentences, `aria-label`s and image `alt` text too; name, address and phone identical in the footer, the visit or contact page and the JSON-LD; update each page's `<title>`, meta description, canonical, `og:url` and `og:image`; delete sample reviews (`data-pl-fill="review"`) unless they gave real ones: each whole review with its name or caption, and the section and its nav link when none is left; in the JSON-LD, delete the sample `geo` coordinates unless you have the real ones; delete pages and sections they don't need, with their nav links; remove the `<!-- Page Lemon template ... -->` comment. Colours only through the `:root` tokens, fonts through the font tokens. Google Fonts sends each visitor's IP address to Google, so offer self-hosted font files. For search and AI answers (titles, JSON-LD types, FAQ, the `seo` hints in the deploy reply), follow https://pagelemon.com/agents/seo. The older one-page templates (no `interview` in `template.json`) have no `data-pl-fill` markers, privacy page or JSON-LD: read every section and replace the sample details by hand, and add a privacy page if you add a form or booking; their `/tp/<Name>` page says so. The template deploy's reply has no `seo` hints (they would be about the sample business); the patch deploy with the real details has them.
3. **Publish only what changed:** `site_publish` with `site`, `base_version` and `patch: true`.

REST: publish the files you fetched as in https://pagelemon.com/agents, then patch the same way. The template's own step-by-step page is `https://pagelemon.com/tp/<Name>`.

### Slots: forms and booking

Templates have no fake forms. Each `data-pl-slot="<id>"` (with `data-pl-kind`) shows a fallback that works today: a call link, a `mailto:` link, or the person's own booking or payment link (ask for it). The designed version sits next to it in an inert `<template data-pl-slot-form="<id>">`.

- **Form slot:** make the form a list with `list_save` (every field a `name` of lowercase letters, digits and `_`), then put the matching `<form>` from the slot into the page in the template's classes, delete the fallback and the `<template>`. More about the markup: https://pagelemon.com/agents/forms.
- **Booking slot:** ask the person for their services, hours and rules and save each service with `booking_service_save` `action=service`. Then build the picker from the slot's design, filling services, days and times from `booking_read` `what=times` (never the samples). The recipe is in https://pagelemon.com/agents/booking. Delete the fallback and the `<template>`.
- **Privacy page:** when a slot becomes a form or booking page, copy the paragraph inside `<template data-pl-privacy="forms">` into `privacy.html` (and delete the `<template>`).
- A slot the person doesn't want: leave its fallback, or remove the section and its links.

## Confirm with the person

Show the person every question, service and rule before saving it, and don't skip their yes.

1. Show every line of `setup_summary`, in the person's language, without shortening it. For a form slot that is every question, whether it is required, where messages go and the thank-you; for booking, the services, hours per day, closed days, rules and who is told.
2. Ask whether it is right; if they change anything, call again with the change.
3. After their clear yes, call the same tool again with the same arguments plus `confirm_token`.

What they confirm is what Page Lemon keeps: a form ignores any field a page sends that isn't on the confirmed list. So the form in the page must match the summary. Do this for each slot, and also show the person the other changes before you publish them: the business facts you filled in (name, address, phone, hours, prices) and the pages you removed.

## Test

1. Before publishing, run the checks from the template: search every file for `data-pl-fill`, the template's fictional business name and its sample phone, email and street, in links too (`tel:`, `mailto:` and map `href`s) (none left); all links between pages work and nav and footer match on every page; body text contrast at least 4.5:1 (large text and buttons 3:1) after any colour change; no horizontal scroll at 320 px; one `h1` per page, a unique `<title>` and meta description per page, alt text on meaningful images.
2. After publishing, make one real test: send one message through each form or book one time, and tell the person the result before saying the form or booking is live. If it fails, fix the settings or the page and test again.
3. Open the live link (`site_read` `what=site`, or the address in the reply) and tell the person what you changed. Tell them which template you used and that they can keep changing the site, or add bookings and forms, by asking.

## Day to day

A site made from a template is the person's site: change it with `site_read` `what=site`, then `site_publish` with `base_version` and `patch: true`; `site_read` `what=versions` and `site_replace` `action=version` undo (https://pagelemon.com/agents "Updating a site"). More languages: https://pagelemon.com/agents/languages. A form is a list with `kind: "form"` on the site itself, so a template's page copied to another site needs that site's own form list and form markup (see the forms guide).

## What Page Lemon refuses, and the fix

| Refused or wrong | Fix to offer |
|---|---|
| A booking slot on a site without a paid plan, or a form or booking slot on a site without an account | Keep the fallback (call, email, their own booking link) and offer the plan; the reply links pricing |
| A `data-pl-fill` default left in the pages | Replace it with the person's fact, or delete the element; never ship the sample |
| A template's form that has a file upload, a password or card and ID numbers | Ask for a link instead, or leave those out (https://pagelemon.com/agents/forms) |
| Field names with spaces or brackets | Rename to lowercase letters, digits and `_` (`first_name`) |
| `patch: true` together with `template` | Send `template` alone, then patch your edits |
| A form field on the page that isn't in the confirmed summary | It is ignored: add the question and confirm again |
| A page that sends a card or password form to another host | Link to the service's own sign-in or payment page |

## Links

- For the person: https://pagelemon.com/docs/templates
- The gallery (people): https://pagelemon.com/templates/ · the list (AIs): https://pagelemon.com/templates/index.json
- Forms: https://pagelemon.com/agents/forms · Booking: https://pagelemon.com/agents/booking · Another language: https://pagelemon.com/agents/languages
- API: https://pagelemon.com/docs/api · MCP tools: https://pagelemon.com/docs/mcp
- All AI guides: https://pagelemon.com/agents
