Body: <p>I'm new to this, so sorry if this is really basic.</p>
  
  <p>I want to display a list of entries in the same category as the main entry in my template, excluding the current entry.</p>
  
  <p>This is my code:</p>
  
  <pre><code>{% for category in entry.tutorialCategory.all() %}
  {% for tutorial in craft.entries
     .section('tutorials')
     .relatedTo(category).all()
     .id('not ' ~ entry.id) %}
         &lt;a href="{{ tutorial.url }}"&gt;{{ tutorial.title }}&lt;/a&gt;
  {% else %}
         There are currently no related tutorials.
  {% endfor %}
  {% endfor %}
  </code></pre>
  
  <p>I always get the 'There are currently no related tutorials.' message though.</p>
  
  <p>Any suggestions on where I'm going wrong?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-05T15:39:25.857Z
Comments.Text: You might have other issues but first thing I see is the `.all()` should be at the end, not before the `.id` clause
Comments.UserDisplayName: Seb
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-05T16:11:12.737Z
Comments.Text: That, was it, thanks Seb!
Comments.UserDisplayName: Jon
Tags: <categories><relatedto>
Title: Showing entries in same category, excluding the current entry
ThreadText: # Showing entries in same category, excluding the current entry
  
  (Asked by: username_0 on 2019-11-04)
  
  I'm new to this, so sorry if this is really basic.
  
  I want to display a list of entries in the same category as the main entry in my template, excluding the current entry.
  
  This is my code:
  
  ```
  {% for category in entry.tutorialCategory.all() %}
  {% for tutorial in craft.entries
     .section('tutorials')
     .relatedTo(category).all()
     .id('not ' ~ entry.id) %}
         <a href="{{ tutorial.url }}">{{ tutorial.title }}</a>
  {% else %}
         There are currently no related tutorials.
  {% endfor %}
  {% endfor %}
  
  ```
  
  I always get the 'There are currently no related tutorials.' message though.
  
  Any suggestions on where I'm going wrong?
  
  **Tags:** categories, relatedto
  
  > **Comments:**
  > **username_1**: You might have other issues but first thing I see is the `.all()` should be at the end, not before the `.id` clause  
  > **username_0**: That, was it, thanks Seb!  
  
  ---
  
  ## 0 answers
  
  