<p>The slugs for the different locales were not the same. Changed those and all fixed.</p>

CC BY-SA 3.0
2015-03-23T00:26:51.753Z
2015-03-23T00:26:51.753Z
Niall Thompson
<p>I have the following code to display entries based on a single category:</p>

<pre><code>{# Identify the primary category you want #}
{% set cat = craft.categories.title('events').level(1).first() %}


{# Grab an array of entries related to the primary category #}
{% set entries = craft.entries.section('projects').relatedTo(cat).find() %}

{% for entry in entries %}

&lt;article class=""&gt;
  &lt;h2&gt;{{ entry.title }}&lt;/h2&gt;
  &lt;h5 class="subtitle"&gt;{{ entry.subtitle }}&lt;/h5&gt;
  &lt;a href="{{ entry.url }}" class="button button--ujarak button--border-thin button--text-thick"&gt;Learn more&lt;/a&gt;&lt;br&gt;
  &lt;hr class="rule rule--dashed"&gt;
&lt;/article&gt;

{% endfor %}
</code></pre>

<p>This works fine for the home locale (en) but on the others it displays all entries regardless of whether the category has been applied to it or not.</p>

<categories><localization>
Show Entries Based on Category - Localised Site
# Show Entries Based on Category - Localised Site

(Asked by: username_0 on 2015-03-23)

I have the following code to display entries based on a single category:
{# Identify the primary category you want #}
{% set cat = craft.categories.title('events').level(1).first() %}


{# Grab an array of entries related to the primary category #}
{% set entries = craft.entries.section('projects').relatedTo(cat).find() %}

{% for entry in entries %}


  {{ entry.title }}
  {{ entry.subtitle }}
  Learn more
  


{% endfor %}

This works fine for the home locale (en) but on the others it displays all entries regardless of whether the category has been applied to it or not.

**Tags:** categories, localization

---

## 1 answers

### Answer by username_0 on 2015-03-23. Score: 1

The slugs for the different locales were not the same. Changed those and all fixed.


---

