<p>If you are trying to get the top most parent entry of a child entry in a structure, you can use <a href="https://buildwithcraft.com/docs/templating/craft.entries#ancestorOf" rel="noreferrer"><code>ancestorOf</code></a>.</p>

<pre><code>{% set parent = craft.entries.ancestorOf(entry).level(1).first() %}
&lt;h1&gt;{{parent.title}}&lt;/h1
</code></pre>

CC BY-SA 3.0
2015-09-24T13:09:36.410Z
2015-09-24T13:09:36.410Z
Aaron Berkowitz
<p>I want to display the current title of the parent structure inside the child template.</p>

<p>How would I do that?</p>

<ul>
<li>Parent (Title: Bla)</li>
<li><ul>
<li>Child (Here I want to display <code>Bla</code>)</li>
</ul></li>
<li><p>Parent (Title: Blablu)</p></li>
<li><ul>
<li>Child (Here I want to display <code>Blablu</code>)</li>
</ul></li>
</ul>

<p>I tried something like (in the child template):</p>

<pre><code>{% set parentTitle = craft.entries.section('structure').level(1).title %}
&lt;h1&gt;{{ parentTitle }}&lt;/h1&gt;
</code></pre>

<p>But that doesn't even result in an error</p>

<structure>
Title of the current parent structure
# Title of the current parent structure

(Asked by: username_0 on 2015-09-24)

I want to display the current title of the parent structure inside the child template.
How would I do that?

Parent (Title: Bla)

Child (Here I want to display Bla)

Parent (Title: Blablu)

Child (Here I want to display Blablu)


I tried something like (in the child template):
{% set parentTitle = craft.entries.section('structure').level(1).title %}
{{ parentTitle }}

But that doesn't even result in an error

**Tags:** structure

---

## 1 answers

### Answer by username_1 on 2015-09-24. Score: 7 | Accepted answer

If you are trying to get the top most parent entry of a child entry in a structure, you can use ancestorOf.
{% set parent = craft.entries.ancestorOf(entry).level(1).first() %}
{{parent.title}}


---

