Skip to content

Instantly share code, notes, and snippets.

@robdecker
Created October 31, 2019 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robdecker/9b502367621c976269ac6411220debf2 to your computer and use it in GitHub Desktop.
Save robdecker/9b502367621c976269ac6411220debf2 to your computer and use it in GitHub Desktop.
[Print items/blocks in region.html.twig] #d8 #twig
{# Loop through items #}
{% for key, child in elements if key|first != '#' %}
<div class="{{ loop.first ? 'class-1' : 'class-2' }}">{{ child }}</div>
{% endfor %}
{# Print items individually #}
{{ elements.machine_name_of_block }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment