Output deprecation error Good Evening,

Please bear with me I'm very new to Craft 3. I'm getting deprecation errors when outputting information.

I'm trying to output a single entry from a section using the following:

{% for entry in craft.entries.section('homepage') %}{{ entry.richText }}{% endfor %}


It is giving me the following error:


  Looping through element queries directly has been deprecated. Use the all() function to fetch the query results before looping over them.
In your example, for entry in craft.entries.section('homepage') is attempting to loop through homepage entries as though they're an array. In Craft CMS 3, this is now deprecated just like the error message is telling you.

That means you need to use .all() when querying entries, meaning...

{% for entry in craft.entries.section('homepage') %}


...becomes...

{% for entry in craft.entries.section('homepage').all() %}


Ryan Irelan produced a nice video about this and it's also covered explicitly in the Craft 3 docs. If you've worked with Craft 2 and you're just getting started with Craft 3, that Changes in Craft 3 guide is an excellent place to start.