Answers.Body: <p>As Douglas mentioned in the comments, if the relation is defined within a Matrix block, then the Matrix block is the source of the relation; not the entry.</p>
  
  <p>Soy you just need to change <code>relatedWorks</code> and <code>relatedPerformers</code> to:</p>
  
  <pre class="lang-twig prettyprint-override"><code>{% set relatedWorks = craft.entries.section('Works').relatedTo(block) %}
  {% set relatedPerformers = craft.entries.section('Performers').relatedTo(block) %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-20T23:09:39.127Z
Answers.LastActivityDate: 2014-10-20T23:09:39.127Z
Answers.UserDisplayName: Brandon Kelly
Body: <p>I have three sections:</p>
  
  <ol>
  <li>Discography</li>
  <li>Performers</li>
  <li>Works</li>
  </ol>
  
  <p>Within "Discography", a Matrix field contains related entries from "Performers" and from "Works".</p>
  
  <p>I am looking to display those related entries in Discography with the code below, but nothing happens (no error, no display):</p>
  
  <pre><code>{% for entry in craft.entries.section('Discography').order('title') %}
  
      {{ entry.title }}
  
      {% for block in entry.discoOeuvres %}
  
          {% set relatedWorks = craft.entries.section('Works').relatedTo(entry) %}
          {% set relatedPerformers = craft.entries.section('Performers').relatedTo(entry) %}
  
          {% for work in relatedWorks %}
              {{ work.title }}
  
              {% for performer in relatedPerformers %}
                  {{ performer.title }}
              {% endfor %}
          {% endfor %}
      {% endfor %}
  {% endfor %}
  </code></pre>
  
  <p>Also tried to follow <a href="https://craftcms.stackexchange.com/questions/2287/how-can-i-display-related-entries-selected-within-a-matrix-field">this solution</a>, with no success...</p>
  
  <p>Where do I miss something?</p>
  
  <p>Thanks for helping.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-10-20T16:41:24.387Z
Comments.Text: I haven't dealt with this specifically, but I know that the relationship is with the `matrix block` and not the `entry`. Have you tried `relatedTo(block)`? (untested). The answer on the page you linked is also correct.
Comments.UserDisplayName: Douglas McDonald
Tags: <entries><matrix><relations>
Title: Related entries in Matrix field
ThreadText: # Related entries in Matrix field
  
  (Asked by: username_0 on 2014-10-20)
  
  I have three sections:
  
  1. Discography
  2. Performers
  3. Works
  
  Within "Discography", a Matrix field contains related entries from "Performers" and from "Works".
  
  I am looking to display those related entries in Discography with the code below, but nothing happens (no error, no display):
  
  ```
  {% for entry in craft.entries.section('Discography').order('title') %}
  
      {{ entry.title }}
  
      {% for block in entry.discoOeuvres %}
  
          {% set relatedWorks = craft.entries.section('Works').relatedTo(entry) %}
          {% set relatedPerformers = craft.entries.section('Performers').relatedTo(entry) %}
  
          {% for work in relatedWorks %}
              {{ work.title }}
  
              {% for performer in relatedPerformers %}
                  {{ performer.title }}
              {% endfor %}
          {% endfor %}
      {% endfor %}
  {% endfor %}
  
  ```
  
  Also tried to follow [this solution](https://craftcms.stackexchange.com/questions/2287/how-can-i-display-related-entries-selected-within-a-matrix-field), with no success...
  
  Where do I miss something?
  
  Thanks for helping.
  
  **Tags:** entries, matrix, relations
  
  > **Comments:**
  > **username_1**: I haven't dealt with this specifically, but I know that the relationship is with the `matrix block` and not the `entry`. Have you tried `relatedTo(block)`? (untested). The answer on the page you linked is also correct.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2014-10-20. Score: 3 | Accepted answer
  
  As username_1 mentioned in the comments, if the relation is defined within a Matrix block, then the Matrix block is the source of the relation; not the entry.
  
  Soy you just need to change `relatedWorks` and `relatedPerformers` to:
  
  ```twig
  {% set relatedWorks = craft.entries.section('Works').relatedTo(block) %}
  {% set relatedPerformers = craft.entries.section('Performers').relatedTo(block) %}
  
  ```
  
  
  ---
  
  