Skip to content

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.

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.

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.

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.

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.