Collections
A collection is a slug, a name, an optional cover image, an introduction, and an
ordered list of product ids. Collections appear in the header and footer, as tiles
on the landing page, and at /collection/<slug>, where the shopâs search and sort
work within them.
The introduction
Section titled âThe introductionâWritten in Markdown under Collections in the admin. It is rendered to HTML on
the server, on every read, through the same sanitiser as pages,
and the storefront receives descriptionHtml and never the source. It appears
under the collectionâs heading and becomes the collectionâs search-result
description.
The admin receives the Markdown source, on a separate collectionDraft shape,
because an editor has to round-trip what the merchant typed.
Ordering
Section titled âOrderingâBoth the order of collections and the order of products within one are persisted and edited with buttons. There is no drag-and-drop, for the reasons on the products page.
Featured products
Section titled âFeatured productsâThe landing pageâs featured section is a normal collection with the reserved slug
featured-products. Create it, add products to it, and they appear. There is no
separate feature flag.
A cover image goes through the same upload path as product images: re-encoded to WebP, EXIF stripped, derivatives generated. See Images.
In the API
Section titled âIn the APIâGET /api/collections returns every collection with its rendered introduction.
/api/store includes them in the snapshot. GET /api/products?collection=<slug>
pages through a collectionâs products for a catalogue too large for the snapshot.