Answers.Body: <p>To set up a section (or check the one you are referring to), in your control panel, go to <strong>Settings</strong> then <strong>Sections</strong>.</p>
  
  <p>To loop through entries on a template, for this service section for example, you do:</p>
  
  <pre><code>{% for entry in craft.entries.section('services').all() %}
      {{ entry.title }} &lt;br&gt;
  {% endfor %}
  </code></pre>
  
  <p>Hope that helps :)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-31T15:41:03.813Z
Answers.Text: Yes, I was confused if the section was an html section or a Craft section so this cleared things up. Thanks!
Answers.UserDisplayName: Tyrannogina regina
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-31T12:25:57.020Z
Answers.LastActivityDate: 2019-01-31T12:55:57.003Z
Answers.LastEditDate: 2019-01-31T12:55:57.003Z
Answers.UserDisplayName: Oli
Body: <p>I am basically wondering where does this <code>section('services')</code> is set up and how. <a href="https://github.com/craftcms/demo/blob/3f224f1f2e260c3e18190b16420c2e661cbb35ee/templates/services/_entry.html#L22" rel="nofollow noreferrer">https://github.com/craftcms/demo/blob/3f224f1f2e260c3e18190b16420c2e661cbb35ee/templates/services/_entry.html#L22</a></p>
  
  <p>I need to loop through the collection entries on the <code>_index.html</code> to display a small card for each one, but I don't know how to reach them from the index.</p>
  
Tags: <craft3><entries>
Title: How can I loop through a collection in the index file?
ThreadText: # How can I loop through a collection in the index file?
  
  (Asked by: username_0 on 2019-01-31)
  
  I am basically wondering where does this `section('services')` is set up and how. <https://github.com/craftcms/demo/blob/3f224f1f2e260c3e18190b16420c2e661cbb35ee/templates/services/_entry.html#L22>
  
  I need to loop through the collection entries on the `_index.html` to display a small card for each one, but I don't know how to reach them from the index.
  
  **Tags:** craft3, entries
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-01-31. Score: 3 | Accepted answer
  
  To set up a section (or check the one you are referring to), in your control panel, go to **Settings** then **Sections**.
  
  To loop through entries on a template, for this service section for example, you do:
  
  ```
  {% for entry in craft.entries.section('services').all() %}
      {{ entry.title }} <br>
  {% endfor %}
  
  ```
  
  Hope that helps :)
  
  > **Comments:**
  > **username_0**: Yes, I was confused if the section was an html section or a Craft section so this cleared things up. Thanks!  
  
  ---
  
  