Answers.Body: <p>The slugs for the different locales were not the same. Changed those and all fixed.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-23T00:26:51.753Z
Answers.LastActivityDate: 2015-03-23T00:26:51.753Z
Answers.UserDisplayName: Niall Thompson
Body: <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>
  
Tags: <categories><localization>
Title: Show Entries Based on Category - Localised Site
ThreadText: # 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 %}
  
  <article class="">
    <h2>{{ entry.title }}</h2>
    <h5 class="subtitle">{{ entry.subtitle }}</h5>
    <a href="{{ entry.url }}" class="button button--ujarak button--border-thin button--text-thick">Learn more</a><br>
    <hr class="rule rule--dashed">
  </article>
  
  {% 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.
  
  
  ---
  
  