4

I am looping through a matrix field and it appears to stop looping when the index reaches 100 but I have more than 100 blocks here. How can I loop through the remaining blocks?

{% for block in entry.myMatrixField %}
    {{ loop.index }}
{% endfor %}
2

The default limit for fetching elements is 100. This can be overridden as follows:

{% for block in entry.myMatrixField.limit(null) %}

Passing in null will grab all of them, or you can pass in the specific number you want:

{% for block in entry.myMatrixField.limit(400) %}

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.