Is there a way to create an array of items, fetch them with .all() and loop through them? For example:

{% set array = array|merge([block]) %}

{% for block in gallery.all() %}
{% endfor %}  
  • 1
    .all() lives in the element query classes, not on an array. If you've already got your results in array format, why not just loop through them directly? – Brad Bell Jul 29 '19 at 18:18
  • I was just curious to know if there is a way to do so, but looping through as an array is fine. – nmsdvid Jul 30 '19 at 6:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.