Skip to content

Route templates ​

A route template is one page design that renders for every item of a kind — every product, every collection, or every category — instead of a separate page for each one. You will usually have at most a handful of these: one for products, one for collections, one for categories.

Creating one ​

Go to Content → Pages, open the Templates tab and click New template. Fill in:

  • Title, for your own reference in Studio.
  • Route pattern — for example /products/:slug for products, or /categories/:path* for categories (categories need the catch-all form because a category's address can be nested, like /categories/tableware/cups).
  • Content schema API ID — what the template renders for. In the builder's Template settings you pick it from a list: Product (catalog), Collection (catalog) or Category (catalog), or one of your own content schemas if your theme defines route templates over something else.
  • Unique slug field — which field of the target identifies the page's address. For products and collections this is their slug; for categories it is their full path, because a category's address is its whole position in the category tree, not just its own name.

Studio refuses a pattern that is invalid or that would collide with another page or template's address.

Building it against a real sample ​

A route template is built and previewed against one real example at a time, so you can see it filled in with actual content rather than guessing. The Preview sample picker at the top of the builder lets you switch which product, collection or category the canvas is currently showing — the layout and every dynamic value update to match your choice.

Fixed content versus dynamic values ​

Every block on a route template works two ways:

  • Left alone, a field holds whatever you type into it, exactly like an ordinary page — the same value on every product page the template renders.
  • Given a dynamic override, a field instead pulls its value from the item being rendered — the product's own title, price, description, image, and so on — so each page the template produces shows that product's own data. The inspector's Dynamic overrides (optional) section explains it the same way: "The block uses its normal settings below. Add an override only where this value should come from the dynamic page entry." You can either point a field straight at one piece of the item's data, or write a short text template that mixes fixed words with one or more dynamic values (a caption reading "From {price}", for instance) — the Available dynamic values list in that section shows exactly what you can use for the current target.

Publishing a route template ​

A route template publishes the same way a page does — see Publishing. Publishing it makes every product (or collection, or category) page it covers reflect the new design on the next rebuild; there is nothing to publish per item.

A note on shared components inside a template ​

Most of a route template can be turned into a shared header, footer or section just like an ordinary page (see The reusable header and footer). The one restriction: a block carrying a dynamic override cannot be saved as a shared component, because a shared component has no single product or collection to pull its values from. Studio explains this in place if you try.

Eldra