Public page data, templates, and section rendering
Follow a visitor URL to PagePayload, then to the template, slot, and section that render its HTML.
CMS resolves the public address and prepares page data. Theme renders HTML from that data. Read public fields and resolved resources from PagePayload. A Worker that hits published SSG HTML returns the artifact directly. The render path below prepares that HTML and also serves requests needing dynamic rendering.
From a URL to page data
- The public site resolves host, path, and locale. CMS supplies a public result through
GET public.cms-page.get, which the public site can call through the in-process Service runtime. - A regular page returns
kind: "page". Redirects, errors, site files, and sitemaps have distinct result types. For a redirect or 404, trace route resolution before inspecting a template. - A page result contains the template, layout, current entry, references, and SEO. The renderer loads the matching template and its sections.
| What you are rendering | Where to read it |
|---|---|
| Current article title, body, or cover reference | payload.entry.fields |
| Current locale and route | payload.locale and payload.route |
| Page template and saved page sections | payload.template and payload.page |
| Resolved public media, entries, or forms | payload.refs, via the theme reference readers |
Private fields stay out of public data. A stored reference can be present while its target is missing from public data, for example because the resource was withdrawn or restricted. Handle missing resolutions in the component.
Read the existing Lite page template
The Lite theme’s packages/theme-lite/templates/page/render.astro takes a PagePayload, passes it to the layout, and renders the main page slot inside it:
<Layout payload={payload}>
<RenderSlot payload={payload} scope="page" name="page.main" />
</Layout>
The page scope reads instances from page sections. The section reads instance values and messages through useSection. For shared content, choose the layout or shared template first, then declare the slot there. The theme development tutorial builds a complete section.
Diagnose three common rendering problems
| Symptom | First place to look |
|---|---|
| The page matches but uses the wrong design | The page’s templateKey and the template actually loaded |
| The title renders but the image fails | The entry’s reference value, payload.refs, and the final file URL |
| Two locales show sections in a different order | A saved locale page can control section membership and order. Inspect the locale’s slot settings |
The verification report covers public resources and static delivery. If preview looks right and the public page is older, inspect its release and rendering path with the delivery guide.