1

In Craft 2, I am looping through Image Assets, but the loop stops after 100 images.
I currently have around 140 images, but only the first 100 appear. Is this a built in limit in Craft 2?

Thanks

 {% for image in craft.assets.kind('image').folderId('72').order('filename') %}

 {{ image.title }}

 {% endfor %}

1 Answer 1

2

Element queries in Craft 2.x has a default limit of 100 (from Craft 3 and onwards, there is no default limit).

To change the default limit in Craft 2, you can pass the desired limit via the .limit() param. To remove the limit entirely, you can pass null:

{% for image in craft.assets.kind('image').folderId('72').order('filename').limit(null) %}
...
1
  • Thanks! I was wondering if it was a default, as I hadn't run up against the limit before.
    – buck1112
    Commented Jul 19, 2022 at 21:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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