Recipes
Recipes are task-oriented guides for things you want to do — require login on a section, send a webhook when a record changes, model a one-to-many relationship. Each recipe assumes you have worked through Learn or know the basics already. They branch where choices exist and link out to reference pages for the full details.
All recipes
- Transforming data on write and read — normalize values on the way in with
@writeresolvers, format them on the way out with@read. - Linking related data — unique constraints, referential integrity, cascade rules, and group constraints across properties.
- Group-based permissions — grant a permission to a group with the built-in
Groupschema. - Sending a webhook when a record changes — attach a Processor and fire an outbound HTTP request after a write completes.
- Paginating a long list — split a container's children across numbered pages with
p:paginate. - Validating uniqueness across two properties — enforce composite uniqueness so individual values can repeat but the combination cannot.
- Dropping into the primitives layer — use
PLDocumentandPLElementfor programmatic reads and writes outside the declarative flow. - Embedding a third-party widget that reads from a schema — load an external library alongside
pagelove.mjsand have it render from[itemprop]elements in the DOM.