Answers.Body: <p>Maybe it feels over the top, cause you could simplify your small request to something like this:</p>
  
  <pre><code>{% for page in craft.entries.section('about').all() %}
  &lt;h1&gt;{{ page.title }}&lt;/h2&gt;
  &lt;p&gt;{{ page.summary }}&lt;/p&gt;
  {% endfor %}
  </code></pre>
  
  <p>Or, if you just want to get the title and the summary of that one single - you could archieve this via:</p>
  
  <pre><code>{% set aboutPage = craft.entries.section('about').one() %}
  &lt;h1&gt;{{ aboutPage.title }}&lt;/h1&gt;
  &lt;p&gt;{{ aboutPage.summary }}&lt;/p&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-22T09:19:17.783Z
Answers.Text: Perfect! Thanks for simplifying it for me!
Answers.UserDisplayName: revlis
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-22T08:16:07.947Z
Answers.LastActivityDate: 2020-05-22T08:16:07.947Z
Answers.UserDisplayName: Marten Brosch
Body: <p>I might be over-engineering this a bit, but I'm looking for a clean way to set up my homepage, for as few database queries and maintaining a DRY setup. The homepage is:</p>
  
  <ul>
  <li>Hero introduction
  
  <ul>
  <li>Fields in a homepage single.</li>
  </ul></li>
  <li>News &amp; Events
  
  <ul>
  <li>Simple blog-like query</li>
  </ul></li>
  </ul>
  
  <p>And then the two parts I'm confused about. Both of these are pulled from other singles.</p>
  
  <ul>
  <li>About Us summary</li>
  <li>Membership info</li>
  </ul>
  
  <p>Is it fine to just query these pages individually? It feels so over the top to do something like</p>
  
  <pre><code>{% set aboutQuery = craft.entries().section('about') %}
  {% set aboutPage = aboutQuery.all() %}
  {% for page in aboutPage %}
    &lt;h1&gt;{{ page.title }}&lt;/h2&gt;
    &lt;p&gt;{{ page.summary }}&lt;/p&gt;
  {% endfor %}
  </code></pre>
  
  <p>I'm sure this is a fairly common setup, so I just want to know what other people do in cases like this.</p>
  
Tags: <templating>
Title: Homepage template / queries
ThreadText: # Homepage template / queries
  
  (Asked by: username_0 on 2020-05-22)
  
  I might be over-engineering this a bit, but I'm looking for a clean way to set up my homepage, for as few database queries and maintaining a DRY setup. The homepage is:
  
  * Hero introduction
    + Fields in a homepage single.
  * News & Events
    + Simple blog-like query
  
  And then the two parts I'm confused about. Both of these are pulled from other singles.
  
  * About Us summary
  * Membership info
  
  Is it fine to just query these pages individually? It feels so over the top to do something like
  
  ```
  {% set aboutQuery = craft.entries().section('about') %}
  {% set aboutPage = aboutQuery.all() %}
  {% for page in aboutPage %}
    <h1>{{ page.title }}</h2>
    <p>{{ page.summary }}</p>
  {% endfor %}
  
  ```
  
  I'm sure this is a fairly common setup, so I just want to know what other people do in cases like this.
  
  **Tags:** templating
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-05-22. Score: 3 | Accepted answer
  
  Maybe it feels over the top, cause you could simplify your small request to something like this:
  
  ```
  {% for page in craft.entries.section('about').all() %}
  <h1>{{ page.title }}</h2>
  <p>{{ page.summary }}</p>
  {% endfor %}
  
  ```
  
  Or, if you just want to get the title and the summary of that one single - you could archieve this via:
  
  ```
  {% set aboutPage = craft.entries.section('about').one() %}
  <h1>{{ aboutPage.title }}</h1>
  <p>{{ aboutPage.summary }}</p>
  
  ```
  
  > **Comments:**
  > **username_0**: Perfect! Thanks for simplifying it for me!  
  
  ---
  
  