Answers.Body: <p>Unfortunately, you can't use Craft's built in relations service for reverse relations lookup with Super Table. This is because there's actually a special case for nested relations, such as a Matrix field. Craft's own relations service has special handling for Matrix fields, which we also need to make use of.</p>
  
  <p>Fortunately, Josh Angell (the star that he is) has submitted a fix for this, without having to hack the core. You'll just need to alter your code to use the following:</p>
  
  <pre><code>{% set reverseRelatedElements = craft.supertable.getRelatedElements({
    relatedTo: {
      targetElement: entry,
      field: 'specialisms.linkToPage'
    },
    section: 'barristers'
  }) %}
  
  {% for relatedEntry in reverseRelatedElements %}
    {{ relatedEntry.title }}
  {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-13T17:56:52.537Z
Answers.Text: @crawf, do you know if there is a way to do a similar thing if the super table in question sits within a matrix block?
Answers.UserDisplayName: Mike Vaux
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-17T15:46:04.480Z
Answers.Text: @MikeVaux did you ever work out if there is a way for ST in Matrix?
Answers.UserDisplayName: Josh Angell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-17T17:13:45.867Z
Answers.Text: @JoshAngell No, afraid not. I didn't look into it in any great depth though.
Answers.UserDisplayName: Mike Vaux
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-10T14:55:12.993Z
Answers.Text: I'm trying to also get this working for an ST in a Matrix. Did anyone get it going?
Answers.UserDisplayName: richardpixel
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-03T07:17:13.053Z
Answers.Text: @richardpixel Any luck? I am stuck on this as well.
Answers.UserDisplayName: Danielle LeComte
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-03T11:28:22.397Z
Answers.Text: @DanielleLeComte Nope. I ended up swapping to Neo. Had similar issues but Benjamin sorted me out.
Answers.UserDisplayName: richardpixel
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-27T12:34:05.840Z
Answers.LastActivityDate: 2015-10-27T12:34:05.840Z
Answers.UserDisplayName: crawf
Body: <p>I'm trying to pull through content based on items within a SuperTable entries field.</p>
  
  <p>After searching around I currently have this:</p>
  
  <pre><code>{% set individuals = craft.entries({section: 'barristers', relatedTo: { targetElement: entry, field: 'specialisms.linkToPage'}}) %}
  {% for entry in individuals %}
    {{ entry.title }}
  </code></pre>
  
  <p>But it's not pulling anything through?</p>
  
  <p>Any help appreciated</p>
  
  <p>Thanks</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-27T12:44:03.667Z
Comments.Text: If `entry` is the entry with the Super Table field it is the `sourceElement` of that relation not the `targetElement`.
Comments.UserDisplayName: carlcs
Tags: <relations><plugin-supertable>
Title: SuperTable and related entries
ThreadText: # SuperTable and related entries
  
  (Asked by: username_0 on 2015-10-27)
  
  I'm trying to pull through content based on items within a SuperTable entries field.
  
  After searching around I currently have this:
  
  ```
  {% set individuals = craft.entries({section: 'barristers', relatedTo: { targetElement: entry, field: 'specialisms.linkToPage'}}) %}
  {% for entry in individuals %}
    {{ entry.title }}
  
  ```
  
  But it's not pulling anything through?
  
  Any help appreciated
  
  Thanks
  
  **Tags:** relations, plugin-supertable
  
  > **Comments:**
  > **username_1**: If `entry` is the entry with the Super Table field it is the `sourceElement` of that relation not the `targetElement`.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2015-10-27. Score: 5 | Accepted answer
  
  Unfortunately, you can't use Craft's built in relations service for reverse relations lookup with Super Table. This is because there's actually a special case for nested relations, such as a Matrix field. Craft's own relations service has special handling for Matrix fields, which we also need to make use of.
  
  Fortunately, username_4 (the star that he is) has submitted a fix for this, without having to hack the core. You'll just need to alter your code to use the following:
  
  ```
  {% set reverseRelatedElements = craft.supertable.getRelatedElements({
    relatedTo: {
      targetElement: entry,
      field: 'specialisms.linkToPage'
    },
    section: 'barristers'
  }) %}
  
  {% for relatedEntry in reverseRelatedElements %}
    {{ relatedEntry.title }}
  {% endfor %}
  
  ```
  
  > **Comments:**
  > **username_3**: @username_2, do you know if there is a way to do a similar thing if the super table in question sits within a matrix block?  
  > **username_4**: @username_3 did you ever work out if there is a way for ST in Matrix?  
  > **username_3**: @username_4 No, afraid not. I didn't look into it in any great depth though.  
  > **username_5**: I'm trying to also get this working for an ST in a Matrix. Did anyone get it going?  
  > **username_6**: @username_5 Any luck? I am stuck on this as well.  
  > **username_5**: @username_6 Nope. I ended up swapping to Neo. Had similar issues but Benjamin sorted me out.  
  
  ---
  
  