<p>Have a look at the 'Going Through Matrix' section at <a href="http://buildwithcraft.com/docs/relations#the-relatedTo-param" rel="noreferrer">http://buildwithcraft.com/docs/relations#the-relatedTo-param</a>.</p>

<pre><code>{% set articles = craft.entries.section('articles').relatedTo({
    targetElement: entry,
    field: 'myMatrixField.fieldHandle'
}) %}
</code></pre>

CC BY-SA 3.0
2015-11-30T21:51:56.083Z
This works. Thanks.

I thought I had tried this and it didn't work, but I must have slipped the block type handle in there along with the field handle.
David Schafer
CC BY-SA 3.0
2015-11-30T21:10:06.023Z
2015-11-30T21:10:06.023Z
crawf
<p>I have a site with channels <em>‘articles’</em> and <em>‘tutorials.’</em> An article entry has a matrix field which contains an entry field to link to a tutorial. Every tutorial is linked from within at least one article.</p>

<p>I would like each tutorial page to link back to the articles it appears in.</p>

<p>If I'm on a tutorial page and have the following code in my template…</p>

<pre><code>{% set articles = craft.entries.section('articles').relatedTo(entry) %}
{{ articles|length }}
</code></pre>

<p>articles|length is always zero.</p>

<p>I did a test with just a simple entry field to link to a tutorial and that works fine. Is there something special that needs to be done to get it to work with a matrix field? Could it be a configuration issue?</p>

<matrix><relations>
Reverse Related entries with Matrix Field
# Reverse Related entries with Matrix Field

(Asked by: username_0 on 2015-11-30)

I have a site with channels ‘articles’ and ‘tutorials.’ An article entry has a matrix field which contains an entry field to link to a tutorial. Every tutorial is linked from within at least one article.
I would like each tutorial page to link back to the articles it appears in.
If I'm on a tutorial page and have the following code in my template…
{% set articles = craft.entries.section('articles').relatedTo(entry) %}
{{ articles|length }}

articles|length is always zero.
I did a test with just a simple entry field to link to a tutorial and that works fine. Is there something special that needs to be done to get it to work with a matrix field? Could it be a configuration issue?

**Tags:** matrix, relations

---

## 1 answers

### Answer by username_1 on 2015-11-30. Score: 6 | Accepted answer

Have a look at the 'Going Through Matrix' section at http://buildwithcraft.com/docs/relations#the-relatedTo-param.
{% set articles = craft.entries.section('articles').relatedTo({
    targetElement: entry,
    field: 'myMatrixField.fieldHandle'
}) %}

> **Comments:**
> **username_0**: This works. Thanks.  I thought I had tried this and it didn't work, but I must have slipped the block type handle in there along with the field handle.  

---

