carsonsuite - 1 year ago

I created and added a Grid into my variables module group, but could not figure out how to loop through it. Most may already know this, but hope this helps others save time if looking through the forum :)

ryanthompson - 1 year ago

Try something like this:

{% for grid in variable('example', 'grid_field') %}
    {{ grid.type }} // The grid stream slug
    {{ grid.some_field }} // Maps automatically to the grid entry
{% endfor %}

Check it out: