Answers.Body: <p>You probably kind of confuse your "apprenticeships categories" with your "apprenticeships" section. Try something like this instead:</p>
  
  <pre><code>{% set relatedEntries = craft.entries({
      section: apprenticeships,
      id: 'not ' ~ entry.id,
      relatedTo: {
          targetElement: entry.apprenticeshipsCatsField
      }
  }) %}
  </code></pre>
  
  <p>You now want to order them by your categories? Have a look at my answer I just posted here: <a href="https://craftcms.stackexchange.com/q/11944/125">"How do I display entries, grouped by distinct categories..."</a>.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-16T12:26:12.757Z
Answers.Text: No. It was a different problem. Combined with a late night and rushing to get something done before I went out I was working with the wrong bit of the template. My original idea worked once I'd put it in the correct place.
Answers.UserDisplayName: foamcow
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-16T13:00:02.700Z
Answers.Text: Different problem? Changing "apprenticeshipsCats" to "apprenticeships" (or "vacancies" – I didn't know your channel handle) looks like exactly what you did in the end?!
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-16T09:04:35.613Z
Answers.LastActivityDate: 2015-10-16T09:04:35.613Z
Answers.LastEditDate: 2017-04-13T12:51:00.200Z
Answers.UserDisplayName: carlcs
Body: <p>On my template I am showing detail of an entry.
  Beneath this I am showing a list of other entries that share the same kind of category relationship as the entry being viewed.</p>
  
  <p>This list currently includes the entry being viewed and I wish to omit that from the list.</p>
  
  <p>I'm retrieving the entries like so:</p>
  
  <pre><code>{% for category in craft.entries.section('apprenticeshipsCats').relatedTo(entry).id('not ' ~ entry.id) %}
  </code></pre>
  
  <p>and had expected the 'not' parameter to do what I wanted but it doesn't seem to be working. entry.id is outputting the correct ID and even if I hardcode the entry id then it still appears in the list.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-16T08:54:58.850Z
Comments.Text: Do you want to list entries from your "apprenticeships" or "apprenticeships categories" section?
Comments.UserDisplayName: carlcs
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-16T12:15:05.340Z
Comments.Text: I'm listing entries from the apprenticeships channel. It's all working fine except for being able to omit the apprenticeship entry which is currently viewed.
Comments.UserDisplayName: foamcow
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-16T12:25:09.500Z
Comments.Text: Ha! I'd actually done it correctly but applied by 'not' criteria to the wrong craft.entries loop. Like an idiot. I'm so amateur!
Comments.UserDisplayName: foamcow
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-16T13:01:18.353Z
Comments.Text: Like I said, wrong section. Compare the solution in your update to what I posted. You notice something?
Comments.UserDisplayName: carlcs
Tags: <entries><relations>
Title: Omitting current entry from list of entries generated from a relationship
ThreadText: # Omitting current entry from list of entries generated from a relationship
  
  (Asked by: username_0 on 2015-10-16)
  
  On my template I am showing detail of an entry.
  Beneath this I am showing a list of other entries that share the same kind of category relationship as the entry being viewed.
  
  This list currently includes the entry being viewed and I wish to omit that from the list.
  
  I'm retrieving the entries like so:
  
  ```
  {% for category in craft.entries.section('apprenticeshipsCats').relatedTo(entry).id('not ' ~ entry.id) %}
  
  ```
  
  and had expected the 'not' parameter to do what I wanted but it doesn't seem to be working. entry.id is outputting the correct ID and even if I hardcode the entry id then it still appears in the list.
  
  **Tags:** entries, relations
  
  > **Comments:**
  > **username_1**: Do you want to list entries from your "apprenticeships" or "apprenticeships categories" section?  
  > **username_0**: I'm listing entries from the apprenticeships channel. It's all working fine except for being able to omit the apprenticeship entry which is currently viewed.  
  > **username_0**: Ha! I'd actually done it correctly but applied by 'not' criteria to the wrong craft.entries loop. Like an idiot. I'm so amateur!  
  > **username_1**: Like I said, wrong section. Compare the solution in your update to what I posted. You notice something?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-10-16. Score: 1 | Accepted answer
  
  You probably kind of confuse your "apprenticeships categories" with your "apprenticeships" section. Try something like this instead:
  
  ```
  {% set relatedEntries = craft.entries({
      section: apprenticeships,
      id: 'not ' ~ entry.id,
      relatedTo: {
          targetElement: entry.apprenticeshipsCatsField
      }
  }) %}
  
  ```
  
  You now want to order them by your categories? Have a look at my answer I just posted here: ["How do I display entries, grouped by distinct categories..."](https://craftcms.stackexchange.com/q/11944/125).
  
  > **Comments:**
  > **username_0**: No. It was a different problem. Combined with a late night and rushing to get something done before I went out I was working with the wrong bit of the template. My original idea worked once I'd put it in the correct place.  
  > **username_1**: Different problem? Changing "apprenticeshipsCats" to "apprenticeships" (or "vacancies" – I didn't know your channel handle) looks like exactly what you did in the end?!  
  
  ---
  
  