Type-based layouts.
A product page, an article and a plain page each need a different layout. You do not wire that up per post. FleekSite picks the layout for a post from its type, so every product renders through your product layout and every article through your article layout.
A post has a type: product, blog, page, event and so on. When a post is requested, the platform renders it through the template whose permalink is the type name with a leading colon. A product, type 3, renders through the template at permalink :product. Inside that template the post is available as page, as post, and by its type name, so a product layout reads {{ product.title }}, {{ product.price | price }} and {{ product.primary_media.url }}.
The layout for each type
Each content type maps to a layout permalink. Create a template at that permalink to control how those posts render.
| Type | Layout permalink |
|---|---|
| blog | :blog |
| product | :product |
| page | :page |
| event | :event |
| collection | :collection |
| service | :service |
| location | :location |
| testimonial | :testimonial |
The full list of types and their layout permalinks is on the post type reference.
Site layouts and theme defaults
A layout is resolved in two places, your site first, then the theme. If your site has a template at :product, it wins. If it does not, the theme's default product layout renders the post. This is how a theme ships a working layout for every type while a site overrides only the ones it wants to change.
Pages resolve by permalink
A standalone page, one you reach by its own URL such as /about, is a template resolved directly by its permalink; it does not go through the type layout mechanism. Type-based layouts are for posts, which are content records rendered through a shared layout for their kind. See The render pipeline for how the two resolve.
Type-based layouts are not the same as the standard {% layout %} tag, which is Coming. The two are complementary: the type picks the layout template, and, once shipped, that template could itself opt into a shared wrapper. See the layout tag reference.