Templates

Emails, PDFs, wallet passes, the app, the website, checkout styling, thermal slips, and seating-map drawings are trees of nodes. Each template has a type string (from getTemplateSchema) and a working copy — the draft tree. Changes stay in that working copy until someone publishes in Loby Cloud. Guests keep seeing the last published version.

Workflow

  1. listMuseums — get the museum id (match by name). Do not guess ids.
  2. listTemplates — every template of that museum. Optionally filter by type.
  3. getGuide — start with templating, then a kind guide (email-templates, print-templates, and so on).
  4. getTemplateSchema — allowed node types, props, styles, and options for that kind.
  5. getTemplate — read the working copy before you change anything.
  6. Edit with insertTemplateNodes (batch), updateTemplateNode, removeTemplateNode, moveTemplateNode, setTemplateOption.
  7. Publish in the product. MCP does not publish.

getTemplateAssignments shows which default emails, PDFs, passes, thermal slips, and checkout styling the museum uses. It does not change them.

Nodes

Open getTemplateSchema so you use allowed types and props. Insert many nodes in one insertTemplateNodes call. Groups (for example LAYER) may include children. TEXT may include text and language.

updateTemplateNode only changes the fields you pass: props, styles, elementStyles, text, language, name, hide. Pass null on a prop key to clear it.

moveTemplateNode placement is INSIDE, ABOVE, or BELOW.

setTemplateOption changes template-level options (subject, background color, pass images, content roots, default styles, app intro). Path names come from getTemplateSchema. For an email subject, pass language too.

Content, fonts, photos

Templates can bind CONTENT nodes and content roots to content models and items (listContentModels, listContentItems). TEXT styles can use uploaded fonts (listFonts). IMAGE nodes and pass options store a photo id; look up a known id with getPhoto (there is no museum-wide photo list).

See Templates, Content, fonts, photos, and Guides.

Previous
Languages
Next
Seating Maps