<p>In your example, <code>for entry in craft.entries.section('homepage')</code> is attempting to loop through <code>homepage</code> entries as though they're an array. In Craft CMS 3, this is now deprecated just like the error message is telling you.</p>

<p>That means you need to use <code>.all()</code> when querying entries, meaning...</p>

<pre><code>{% for entry in craft.entries.section('homepage') %}
</code></pre>

<p>...becomes...</p>

<pre><code>{% for entry in craft.entries.section('homepage').all() %}
</code></pre>

<p>Ryan Irelan produced <a href="https://mijingo.com/lessons/using-dot-all-in-craft-3-element-queries/" rel="nofollow noreferrer">a nice video about this</a> and it's also <a href="https://docs.craftcms.com/v3/changes-in-craft-3.html#element-queries" rel="nofollow noreferrer">covered explicitly in the Craft 3 docs</a>. If you've worked with Craft 2 and you're just getting started with Craft 3, that <a href="https://docs.craftcms.com/v3/changes-in-craft-3.html" rel="nofollow noreferrer"><em>Changes in Craft 3</em></a> guide is an excellent place to start.</p>

CC BY-SA 4.0
2019-02-03T22:12:39.330Z
Perfect thank you Matt,  im returning to craft after quite some time, so appreciate the heads up.  Is there a quick guide for outputing images from an entry?
springboynick
CC BY-SA 4.0
2019-02-03T22:19:25.357Z
It depends on how you've configured your Entries, and _how_ you want to output that image. You'll probably want to take a look at the [templating section of the Assets Fields docs](https://docs.craftcms.com/v3/assets-fields.html#templating), and if you're getting used to Craft again it might help more broadly to take a look at the [Happy Lager demo site](https://github.com/craftcms/demo) to see some common patterns in the context of a small site.
Matt Stein
CC BY-SA 4.0
2019-02-03T22:25:01.107Z
Im using an Asset field called 'banner', within a section called 'homepage',  I assumed id be able to call the url from it easily. i must be missing something
springboynick
CC BY-SA 4.0
2019-02-03T22:27:50.093Z
That doesn't seem relevant to the question or answer here. If you're looking for examples, I still strongly recommend looking through the Happy Lager demo site I linked to. If you'd like to chat with someone this isn't the right place for that, but the Craft CMS Slack group is perfect: https://craftcms.com/community.

Please consider asking clear questions here and staying on topic, and accepting answers (on _any_ Stack Exchange site) that you find to be most helpful.
Matt Stein
CC BY-SA 4.0
2019-02-03T22:09:45.770Z
2019-02-03T22:09:45.770Z
Matt Stein
<p>Good Evening,</p>

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

<p>I'm trying to output a single entry from a section using the following:</p>

<pre><code>{% for entry in craft.entries.section('homepage') %}{{ entry.richText }}{% endfor %}
</code></pre>

<p>It is giving me the following error:</p>

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

<craft3>
Output deprecation error
# Output deprecation error

(Asked by: username_0 on 2019-02-03)

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.

**Tags:** craft3


---

## 1 answers

### Answer by username_1 on 2019-02-03. Score: 2 | Accepted answer

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.

> **Comments:**
> **username_0**: Perfect thank you Matt,  im returning to craft after quite some time, so appreciate the heads up.  Is there a quick guide for outputing images from an entry?  
> **username_1**: It depends on how you've configured your Entries, and _how_ you want to output that image. You'll probably want to take a look at the [templating section of the Assets Fields docs](https://docs.craftcms.com/v3/assets-fields.html#templating), and if you're getting used to Craft again it might help more broadly to take a look at the [Happy Lager demo site](https://github.com/craftcms/demo) to see some common patterns in the context of a small site.  
> **username_0**: Im using an Asset field called 'banner', within a section called 'homepage',  I assumed id be able to call the url from it easily. i must be missing something  
> **username_1**: That doesn't seem relevant to the question or answer here. If you're looking for examples, I still strongly recommend looking through the Happy Lager demo site I linked to. If you'd like to chat with someone this isn't the right place for that, but the Craft CMS Slack group is perfect: https://craftcms.com/community.  Please consider asking clear questions here and staying on topic, and accepting answers (on _any_ Stack Exchange site) that you find to be most helpful.  

---

