Questions tagged [forloop]

For loop is a statement executing some code repeatedly (forever or till some condition exists it)

4 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
136 views

Error while sending QUERY packet. PID=881 when using cache key

If I do: {% set cacheKey = block.id %} {% cache using key cacheKey if craft.app.config.general.cache %} {% for item in items %} <div class="swiper-slide ais-hits--item" data-id="{{ ...
0
votes
0answers
23 views

How to create an array of items and fetch them with .all()?

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 %}
0
votes
0answers
50 views

How do I create an index page that loop through the table fields of its entries?

Every entry in a section has a table. The table depicts sales over 7 years. I want to create an index page that lists the title of each entry and the sales for each entry in the section. I know ...
0
votes
0answers
92 views

Imager plugin not working inside the loop

so I am using trying to use the Imager plugin to compress my images. It works fine this way: {% set imagePath = "/path/to/img.jpg" %} {% set compressed = craft.imager.transformImage(imagePath,...