<p>You just need to check if it's related to the current entry. <code>entry</code> is the entry you're displaying.</p>

<pre><code>{% for category in craft.categories().group('someGroup').relatedTo(entry).all() %}
    {{ category.title }}
{% endfor %}
</code></pre>

CC BY-SA 4.0
2019-10-11T10:06:05.643Z
Thanks for the answer Simon, it works perfectly :)
Martin
CC BY-SA 4.0
2019-10-10T16:40:58.560Z
2019-10-10T16:40:58.560Z
Simon Kuran
<p>I have a Category Group with an Entries field assigned so the admin can select which existing Entries should fall within a given category.  An Entry can be assigned to multiple categories.</p>

<p>On the Entry page I want to be able to loop through the categories and only list those where the entry has been included.</p>

<p>There are six categories vs 20 or 30 entries so doing it the other way (assigning a category to the entry) would be cumbersome for end user editing if a new category is added.</p>

<p>I hope that makes sense?</p>

<templating><categories><entries-field>
Show Category Title only where an entry has been included in an Entries field
# Show Category Title only where an entry has been included in an Entries field

(Asked by: username_0 on 2019-10-10)

I have a Category Group with an Entries field assigned so the admin can select which existing Entries should fall within a given category. An Entry can be assigned to multiple categories.

On the Entry page I want to be able to loop through the categories and only list those where the entry has been included.

There are six categories vs 20 or 30 entries so doing it the other way (assigning a category to the entry) would be cumbersome for end user editing if a new category is added.

I hope that makes sense?

**Tags:** templating, categories, entries-field

---

## 1 answers

### Answer by username_1 on 2019-10-10. Score: 1 | Accepted answer

You just need to check if it's related to the current entry. entry is the entry you're displaying.
{% for category in craft.categories().group('someGroup').relatedTo(entry).all() %}
    {{ category.title }}
{% endfor %}

> **Comments:**
> **username_0**: Thanks for the answer Simon, it works perfectly :)  

---

