Answers.Body: <p>Here's another good example for working with categories that may be useful to you. This will loop through all categories (that have entries) and show their entries:</p>
  
  <pre><code>{% set entries = craft.entries.section('someSection').limit(null) %}
  
  {% for category in craft.categories.group('someCategoryGroup').relatedTo(entries) %}
      &lt;h2&gt;{{ category }}&lt;/h2&gt;
  
      {% for entry in entries.relatedTo(category) %}
          {{ entry.title }}
      {% endfor %}
  
  {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-05T01:21:54.803Z
Answers.LastActivityDate: 2014-07-05T01:21:54.803Z
Answers.UserDisplayName: Simon Kuran
Answers.Body: <p>This example assumes you have your <a href="http://buildwithcraft.com/docs/categories#category-groups" rel="nofollow">Category Group</a> setup to use custom URLs.  In the template used to display your categories, the <code>category</code> variable will be available and represent your <a href="http://buildwithcraft.com/docs/templating/categorymodel" rel="nofollow">CategoryModel</a> for that page.</p>
  
  <p>The key is to pass the <code>CategoryModel</code> (in our example below <code>category</code>) to the <code>relatedTo</code> parameter of the Entries tag.</p>
  
  <pre><code>{{ category.title }}
  
  {% paginate craft.entries
      .section('articles')
      .relatedTo(category)
      .limit(10) 
      as entries 
  %}
  
      {% if entries|length %}
  
          {# Content #}
          {% for entry in entries %}
              {{ entry.title }}
          {% endfor %}
  
          {# Pagination #}
  
      {% else %}
  
          &lt;p&gt;No items have been added to this Category yet.&lt;/p&gt;
  
      {% endif %}
  
  {% endpaginate %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-05T09:57:24.333Z
Answers.Text: Thanks Ben, this has allowed me to loop through all the entries in my channel (only have 1 as I'm using the personal version), I think I am missing something, maybe in the setup of my category group. I'll go back to it and have a root around, many thanks.
Answers.UserDisplayName: bobbyballbags
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-04T22:25:08.573Z
Answers.LastActivityDate: 2014-08-04T05:02:47.890Z
Answers.LastEditDate: 2014-08-04T05:02:47.890Z
Answers.UserDisplayName: Ben Parizek
Body: <p>I have a category set up and have added entries to it. How do I loop through these entries, and output just the title of each entry?</p>
  
  <p>Serious noob here but trying to learn, any help would be gratefully received.</p>
  
Tags: <templating><categories><loop>
Title: How can I create a simple loop through entries in a category?
ThreadText: # How can I create a simple loop through entries in a category?
  
  (Asked by: username_0 on 2014-07-04)
  
  I have a category set up and have added entries to it. How do I loop through these entries, and output just the title of each entry?
  
  Serious noob here but trying to learn, any help would be gratefully received.
  
  **Tags:** templating, categories, loop
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2014-07-04. Score: 6 | Accepted answer
  
  This example assumes you have your [Category Group](http://buildwithcraft.com/docs/categories#category-groups) setup to use custom URLs. In the template used to display your categories, the `category` variable will be available and represent your [CategoryModel](http://buildwithcraft.com/docs/templating/categorymodel) for that page.
  
  The key is to pass the `CategoryModel` (in our example below `category`) to the `relatedTo` parameter of the Entries tag.
  
  ```
  {{ category.title }}
  
  {% paginate craft.entries
      .section('articles')
      .relatedTo(category)
      .limit(10) 
      as entries 
  %}
  
      {% if entries|length %}
  
          {# Content #}
          {% for entry in entries %}
              {{ entry.title }}
          {% endfor %}
  
          {# Pagination #}
  
      {% else %}
  
          <p>No items have been added to this Category yet.</p>
  
      {% endif %}
  
  {% endpaginate %}
  
  ```
  
  > **Comments:**
  > **username_0**: Thanks Ben, this has allowed me to loop through all the entries in my channel (only have 1 as I'm using the personal version), I think I am missing something, maybe in the setup of my category group. I'll go back to it and have a root around, many thanks.  
  
  ---
  
  ### Answer by username_1 on 2014-07-05. Score: 6
  
  Here's another good example for working with categories that may be useful to you. This will loop through all categories (that have entries) and show their entries:
  
  ```
  {% set entries = craft.entries.section('someSection').limit(null) %}
  
  {% for category in craft.categories.group('someCategoryGroup').relatedTo(entries) %}
      <h2>{{ category }}</h2>
  
      {% for entry in entries.relatedTo(category) %}
          {{ entry.title }}
      {% endfor %}
  
  {% endfor %}
  
  ```
  
  
  ---
  
  