Skip to content

Instantly share code, notes, and snippets.

@webrgp
Created July 13, 2022 15:17
Show Gist options
  • Save webrgp/4f03f99693d870354dd0093874a937a4 to your computer and use it in GitHub Desktop.
Save webrgp/4f03f99693d870354dd0093874a937a4 to your computer and use it in GitHub Desktop.
CraftCMS content blocks partial
{# prettier-ignore #}
{% if blocks is defined and blocks is iterable %}
{% for blk in blocks %}
{% if blk.type is defined %}
{% include '_blocks/_' ~ blk.type ~ '.twig' ignore missing with {
blk: blk,
index: loop.index,
} %}
{% endif %}
{% endfor %}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment