$ data
Data-driven pages
Bind a page template to a collection and hostdocs renders your records into it — a list page for all records, or a detail page per record.
Team & Pro
Data-driven (collection-bound) pages are available on the Team and Pro plans.
The idea
Build a collection of typed records, then publish a page whose HTML contains template tokens. hostdocs fills the tokens with record data at request time. The template is a normal hostdocs document — build and preview it like any page.
Template syntax
{{ fieldKey }}— interpolate a field value (HTML-escaped).{{{ fieldKey }}}— interpolate raw (unescaped) HTML.{{#each listField}} … {{/each}}— loop a list field’s items. Use{{ this }}for primitive items or{{ itemKey }}for object items.
<h1>{{ name }}</h1>
<p>{{ description }}</p>
<ul>
{{#each features}}<li>{{ this }}</li>{{/each}}
</ul>Missing keys render as empty. Templates are validated against the collection’s fields when you save.
List vs detail
- List — renders all records at a base path (e.g.
/products). The template has access to the fullrecordsset to loop over. - Detail — renders one record per URL slug under the base path (e.g.
/products/<slug>). Requires a slug field on the collection — the field whose value becomes each record’s URL.
Build one
- Create a collection and define its fields.
- For detail pages, set the collection’s slug field.
- Add records.
- Publish a page bound to the collection — paste the template HTML, pick the base path, and choose list or detail.
You can do this end-to-end from Claude or ChatGPT — see the MCP reference for the collection, record, and bind tools.