<p>You can query for that parent page's entry model with a <a href="http://buildwithcraft.com/docs/templating/elementcriteriamodel" rel="noreferrer">new ElementCriteriaModel</a>.</p>

<pre><code>{% set mainEntry = craft.entries.id(100).first() %}

{% if mainEntry %}
    {% set matrixField = mainEntry.matrixFieldHandle %}
    {% set firstContentBlock = matrixField.type('content').first() %}

    {% if firstContentBlock %}
        {{ firstContentBlock.myRichTextFieldHandle }}
    {% endif %}
{% endif %}
</code></pre>

<p>Instead of using the entry's ID as the link to that entry, you can also use <a href="http://buildwithcraft.com/docs/templating/craft.entries" rel="noreferrer">other parameters</a> to query for the entry model. Here's an example using slug and section:</p>

<pre><code>{% set mainEntry = craft.entries.section('news').slug('main-news').first() %}
</code></pre>

CC BY-SA 3.0
2015-08-26T15:29:13.203Z
Worked great, thanks! I guess the distinction I had to understand was I'm getting info from the entry, not the field. so you have to return query the model using the slug or ID. Makes sense!
Sebastian Thomas
CC BY-SA 3.0
2015-08-26T13:08:55.767Z
2015-08-26T13:08:55.767Z
carlcs
<p>I guess this isn't possible as it would mean the content is essentially a Global, but I would like to be able use a block from a matrix field from another entry. </p>

<p>At the moment I have a parent page with a block of content, which I would like to replicate on all of it's child pages. I don't want to make the user repeat it on each child page, but I don't want to hardcode it. </p>

<matrix><entry>
Possible to get content block from another entry?
# Possible to get content block from another entry?

(Asked by: username_0 on 2015-08-26)

I guess this isn't possible as it would mean the content is essentially a Global, but I would like to be able use a block from a matrix field from another entry.

At the moment I have a parent page with a block of content, which I would like to replicate on all of it's child pages. I don't want to make the user repeat it on each child page, but I don't want to hardcode it.

**Tags:** matrix, entry

---

## 1 answers

### Answer by username_1 on 2015-08-26. Score: 5 | Accepted answer

You can query for that parent page's entry model with a new ElementCriteriaModel.
{% set mainEntry = craft.entries.id(100).first() %}

{% if mainEntry %}
    {% set matrixField = mainEntry.matrixFieldHandle %}
    {% set firstContentBlock = matrixField.type('content').first() %}

    {% if firstContentBlock %}
        {{ firstContentBlock.myRichTextFieldHandle }}
    {% endif %}
{% endif %}

Instead of using the entry's ID as the link to that entry, you can also use other parameters to query for the entry model. Here's an example using slug and section:
{% set mainEntry = craft.entries.section('news').slug('main-news').first() %}

> **Comments:**
> **username_0**: Worked great, thanks! I guess the distinction I had to understand was I'm getting info from the entry, not the field. so you have to return query the model using the slug or ID. Makes sense!  

---

