1

Why is this depreciated? Is there an example of the preferred method?

Looping through element queries directly has been deprecated. Use the all() function to fetch the query results before looping over them.

Thanks.

0

It means you've got a loop on an element query somewhere in your templates. For example:

{% for entry in craft.entries.section('mySection') %}
    {{ entry.title }}
{% endfor %}

You should update it to use .all() like so:

{% for entry in craft.entries.section('mySection').all() %}
    {{ entry.title }}
{% endfor %}

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.