Website design

Templates

Build reusable page layouts and understand which template a public route selects.

GroCMS 0.1.0 · Reviewed 15 September 2026

Download this guide

A layout shared by many entries

A template defines the arrangement for a kind of public page. It does not duplicate each article's writing. For example, a single:post template can contain Content title, Content details, and Content body; the same arrangement then reads the current post's fields. Updating and publishing that template changes the shared presentation while leaving the posts' stored bodies intact.

The template's Title helps colleagues find it in Templates. Template matching → Template key determines its automatic role. A template slug is not a public page route. Create a Page when you need an address such as /about; create a template when you need a layout that can be selected for that Page or a class of pages.

Sources: Public page selection and resource resolution; Configured website components; Resource editor and design resource fields.

Create or update a template

  1. Open Templates. Edit the existing record for the role you need, or create a new template with a descriptive title such as Article layout.
  2. In Details, choose its Template key. Open Visual editor and insert the Editorial article pattern for a content-led starting point, or assemble your own components.
  3. Use Content title and Content body for values that should change with each entry. Add fixed Rich text only when every entry should display that same wording.
  4. Save, Preview, and inspect the intended type of public page. Publish referenced menus or shared sections first, then publish the template.

A template preview needs suitable content context to demonstrate connected fields. A placeholder does not necessarily mean the component is broken. Check a representative published entry with the template applied. For event or vehicle pages, the public frame also renders their structured details; the current visual controls do not provide a separate configurable component for every individual field.

Sources: Resource editor and design resource fields; Puck integration and editor configuration; Built-in layout patterns; Revision and publication service.

Template keys available in the interface

KeyUse
homeThe homepage's automatic template candidate at /.
pageThe fallback specific to ordinary Pages.
single:postIndividual posts.
single:eventIndividual events.
single:vehicleIndividual vehicles.
archiveArchive and taxonomy listing fallback.
searchThe search page's main composition; its search form and result listing are supplied separately.
404The missing-page composition; the response remains a missing-page response.
indexThe broad fallback when a more specific automatic match is unavailable.

The resolver also understands additional type-specific archive and taxonomy keys, but the current Template key dropdown exposes the choices above. Do not expect to type arbitrary new keys into that select. Extending the interface or configuring additional supported keys is a developer/API task.

Sources: Resource editor and design resource fields; Public page selection and resource resolution; Public website frame and theme application.

Why a different layout may win

For an entry, its own custom composition takes precedence over every template. If there is no custom composition, a Template explicitly selected in Organization takes precedence over automatic matching. Otherwise, a post checks single:post, single, then index; a Page checks single:page, page, then index. At the configured homepage, home is inserted ahead of those automatic candidates.

An empty custom composition is still a composition. Removing every block does not make a Page inherit a template again. Restore a revision without the custom composition, or ask an authorized developer to clear it through the API. Only one template can be published for a given key: publishing a second one produces a conflict. Edit the existing template rather than expecting a new record to outrank it.

Sources: Public page selection and resource resolution; Public website frame and theme application; Resource editor and design resource fields; Revision and publication service.

Templates and the surrounding website

Global header and footer sections sit outside the selected main composition. Archive and search result grids are also rendered by the public frame and retain their own pagination. Adding a Content collection inside an archive template adds another collection; it does not replace the existing result list or become its filtering control.

For a practical post template, place Content title, Content details, and Content body inside a Paper Section with Generous spacing. Add a Shared section below for a reusable editorial sign-off. Keep a promotional Hero on a home template if it should appear only on the front page, rather than placing it in index where it could affect unrelated routes.

Sources: Public website frame and theme application; Public page selection and resource resolution; Configured website components.

Permissions, publication, and troubleshooting

Administrators and designers can create, edit, preview, publish, and withdraw templates. The Editor role does not manage these design resources under the current policy. Publishing a template publishes its saved revision, not unsaved typing and not the drafts of its dependencies. Existing pages that use the template pick up its new published layout without republishing their body text.

  • If nothing changes, inspect the entry's custom composition and explicit Template selection before changing the automatic key.
  • If publication reports a required linked resource, publish that public dependency first; selecting a draft does not publish it automatically.
  • If writing disappears, add Content body rather than retyping the article into a Rich text block.
  • To undo a layout change, use Revision history → View revision → Restore as working draft, inspect it, then publish the restored draft.

Sources: Role and resource permissions; Revision and publication service; Resource editor and design resource fields.