Overriding index, show, taxonomy, lists, and block sections.
Template resolution
Twig resolves templates child-first, then parents, then core. Common paths:
| View | Template path |
|---|---|
| Single entry | content/{typeSlug}/show.twig → content/show.twig |
| Type archive | content/{typeSlug}/index.twig → content/index.twig |
| Taxonomy archive | taxonomy/archive.twig or type-specific variants |
| Content list page | content_lists/{listSlug}.twig → content_lists/show.twig |
| Block section | sections/{sectionKey}.twig |
Variables on show.twig
content_type,content_entrycontent_field_rows— Field definitions with valuesentry_taxonomy_groupscontent_entry_sections_html— Rendered block builder outputcontent_entry_has_sections- SEO variables from meta builder
theme_settings, menus,site_url
Rendering entry_refs
{% for row in content_field_rows if row.field_type == 'entry_refs' %}
<h3>{{ row.label }}</h3>
<ul>
{% for ref in entry_refs_resolve(row.value) %}
<li><a href="{{ ref.public_url }}">{{ ref.title }}</a></li>
{% endfor %}
</ul>
{% endfor %}
Embedding content lists
{% set pack = content_list('featured-guides', 4) %}
<div class="card-grid">
{% for card in pack.entries %}
{% include 'partials/entry_card.twig' with { card: card } %}
{% endfor %}
</div>
Commerce products
When the entry is a configured product type, templates receive commerce_product and may include commerce/_buy_form.twig. Hide raw price fields from the field loop when commerce form renders them.
Extend the right layout
{% extends 'layouts/base.twig' %}
{# or {% extends theme_layout() %} #}
Do not extend core base.twig on storefront content templates.
Troubleshooting
- Wrong template picked — Check type slug spelling; clear Twig cache.
- Blocks unstyled — Section partials need CSS in theme assets, not core marketing CSS.