Related entries in Matrix field I have three sections:


Discography
Performers
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, with no success...

Where do I miss something?

Thanks for helping.
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.

Soy you just need to change relatedWorks and relatedPerformers to:

{% set relatedWorks = craft.entries.section('Works').relatedTo(block) %}
{% set relatedPerformers = craft.entries.section('Performers').relatedTo(block) %}