Composing pages
Reference for the HTML patterns that assemble pages from parts — bindings that compute values, templates that render lists, includes that pull content from other documents, filters that transform values, and elements that exist only during composition.
Most of these are schema-free: they work on plain HTML and the site graph with no modeled type at all. One is schema-powered — Method Elements invoke a Method declared on a schema, so they require modeling a type first. See What modeling unlocks in pages for the progression.
These same composition patterns also work for XML documents — RSS/Atom feeds, sitemaps, SVG, and XHTML (any +xml content type, plus application/xml and text/xml). An XML document is parsed and composed with the same directives — including microdata @read resolution — and served as well-formed XML (empty elements self-close, tag/attribute case is preserved, and the <?xml … ?> declaration is kept). The HTML-only conveniences that do not apply are JSON-LD content negotiation and xmlns: declaration stripping. See XML documents for the full reference.
Pages in this group
- Bindings — attach a named value to an element during composition:
- Resource Binding — bind a site-wide CSS selector query to a named variable (
r:) - Sessel expression binding — compute a value from a Sessel expression (
e:) - JavaScript expression binding — compute a value from a JavaScript expression (
j:)
- Resource Binding — bind a site-wide CSS selector query to a named variable (
- Templating with Liquid — server-side templates (Templating) and the filter library now live under Languages → Liquid
- Pagination — splitting long lists across pages
- Resource Creation — creating new resources via
PUTandPOST - Selector Extensions — Pagelove-specific CSS selector syntax
- Method Elements — call a Schema-defined Method (Sessel or JavaScript) by name via an XML namespace prefix (requires a modeled schema)
- Stamp — emit a bound
Contextvalue into the document with<p:stamp>(the built-in method that renders a binding inline) - XML documents — compose RSS/Atom feeds, sitemaps, and SVG with the same directives, served as valid XML
- Includes — pull a fragment of another document into the current page
- Transient Elements — session-scoped elements that never reach storage
- Parameterized routes — serve many URLs from one document stored at a
:parampath
See also
- Modeling data — schemas, properties, and validators
- Reading and writing — the HTTP methods that read and write the fragments composition assembles