<p>Craft site has the excellent document <a href="http://buildwithcraft.com/help/entries-related-to-category" rel="nofollow">How do I list the entries related to a category?</a></p>

<p>Building on that, you would fetch your category (by slug), and then the entries related to the category.</p>

<pre><code>{# Fetch the category with slug 'categorySlug' #}
{% set category = craft.categories.slug('categorySlug').first() %}

{# Fetch all of the entries related to this category #}
{% set entries = craft.entries.relatedTo(category) %}
</code></pre>

<p>Then loop over those entries.</p>

CC BY-SA 3.0
2014-08-05T19:12:00.003Z
This worked. Not sure that I understand how. But not I have something to study. Thanks
David A McInnis
CC BY-SA 3.0
2014-08-05T19:20:58.767Z
@David If you're still trying to understand how categories work I would recommend looking through the questions on [categories](http://craftcms.stackexchange.com/questions/tagged/categories) here on SE. There are some answers with very useful and basic examples.
Simon Kuran
CC BY-SA 3.0
2014-08-05T18:59:49.730Z
2014-08-05T18:59:49.730Z
Marion Newlevant
<p>I have a category group set up called 'gists'. I have entries that contain a category field which pulls in the category group 'gists'. </p>

<p>Now I need to access entries that are tied to individual categories but I need to do so by the category slug.</p>

<p>I cannot figure out how to make this happen. I have tried numerous things but cannot get my head around this. Here is my latest.</p>

<pre><code>{% for entry in craft.entries.section('gist').relatedTo('tech').limit(10).find() %}
</code></pre>

<entries><categories>
Wrapping my head around Categories
# Wrapping my head around Categories

(Asked by: username_0 on 2014-08-05)

I have a category group set up called 'gists'. I have entries that contain a category field which pulls in the category group 'gists'. 
Now I need to access entries that are tied to individual categories but I need to do so by the category slug.
I cannot figure out how to make this happen. I have tried numerous things but cannot get my head around this. Here is my latest.
{% for entry in craft.entries.section('gist').relatedTo('tech').limit(10).find() %}

**Tags:** entries, categories

---

## 1 answers

### Answer by username_1 on 2014-08-05. Score: 3

Craft site has the excellent document How do I list the entries related to a category?
Building on that, you would fetch your category (by slug), and then the entries related to the category.
{# Fetch the category with slug 'categorySlug' #}
{% set category = craft.categories.slug('categorySlug').first() %}

{# Fetch all of the entries related to this category #}
{% set entries = craft.entries.relatedTo(category) %}

Then loop over those entries.

> **Comments:**
> **username_0**: This worked. Not sure that I understand how. But not I have something to study. Thanks  
> **username_2**: @David If you're still trying to understand how categories work I would recommend looking through the questions on [categories](http://craftcms.stackexchange.com/questions/tagged/categories) here on SE. There are some answers with very useful and basic examples.  

---

