<p>the simple answer is: yes it is an acceptable method!</p>

<p>In single sections or in a single entry of a structure or channel, this is totally fine. </p>

<p>You need the entries query if you want to do something like having a list of all recent blog posts on your homepage. So on your index.twig the "entry" object has got all data for the homepage, like title, url and all fields! </p>

<p>Example index.twig:</p>

<pre><code>&lt;h1&gt;{{entry.title}}&lt;/h1&gt; &lt;---(the title of your site)

{% set blogPosts = craft.entries().section('blog') %}
{% for entry in blogPosts.all() %}
  {{ entry.title }} &lt;---- (the title of a blogpost)
{% endfor %} 
</code></pre>

CC BY-SA 4.0
2020-05-29T15:59:50.167Z
Thank you! This is what I was doing, and now I know its safe. I am assuming if I want to eager load elements for these singles then I would need to do a query.
Chris Grant
CC BY-SA 4.0
2020-05-28T07:16:52.530Z
2020-05-28T07:16:52.530Z
Marten Brosch
<p>Craft Pro 3.4.20</p>

<p>New to craft development. I was following the documentation and calling my entries via the suggested method as outlined <a href="https://docs.craftcms.com/v3/dev/element-queries/entry-queries.html#example" rel="nofollow noreferrer">https://docs.craftcms.com/v3/dev/element-queries/entry-queries.html#example</a>.</p>

<p>However I have found that I can access any fields via <code>entry.&lt;fieldName&gt;</code> within my twig templates without setting the entry query, so long as that template has been assigned to that section. </p>

<p>For example, my homepage has a template set in the cp, and I can access all its field entries without any query within the twig template, I just call <code>entry.title</code> like anything else and it works.</p>

<p>My question is this—is this an acceptable method? Are there any performance issues with this?</p>

CC BY-SA 4.0
2020-05-28T07:11:37.580Z
This is perfectly fine and the way it was intended :)
Oli
<craft3>
entry is available without query when templates are set in the CP, is this an acceptable method?
# entry is available without query when templates are set in the CP, is this an acceptable method?

(Asked by: username_0 on 2020-05-27)

Craft Pro 3.4.20

New to craft development. I was following the documentation and calling my entries via the suggested method as outlined <https://docs.craftcms.com/v3/dev/element-queries/entry-queries.html#example>.

However I have found that I can access any fields via `entry.` within my twig templates without setting the entry query, so long as that template has been assigned to that section.

For example, my homepage has a template set in the cp, and I can access all its field entries without any query within the twig template, I just call `entry.title` like anything else and it works.

My question is this—is this an acceptable method? Are there any performance issues with this?

**Tags:** craft3
> **Comments:**
> **username_1**: This is perfectly fine and the way it was intended :)  

---

## 1 answers

### Answer by username_2 on 2020-05-28. Score: 2

the simple answer is: yes it is an acceptable method!
In single sections or in a single entry of a structure or channel, this is totally fine. 
You need the entries query if you want to do something like having a list of all recent blog posts on your homepage. So on your index.twig the "entry" object has got all data for the homepage, like title, url and all fields! 
Example index.twig:
{{entry.title}} <---(the title of your site)

{% set blogPosts = craft.entries().section('blog') %}
{% for entry in blogPosts.all() %}
  {{ entry.title }} <---- (the title of a blogpost)
{% endfor %}

> **Comments:**
> **username_0**: Thank you! This is what I was doing, and now I know its safe. I am assuming if I want to eager load elements for these singles then I would need to do a query.  

---

