Get parent page title from a modular template

I’m trying to figure out how to get the parent page title from one of the modular partials. So I have:

01.intro
   _header
      header.md
   _body
   modular.md

I want the header.md file to display the page title of the modular.md not the page title of itself. I currently have

{% set patternTitle = page.title %}

set in the header.html.twig, but it only reads from itself (header.md) and not the parent (modular.md).

help?

It is just as you would expect it to be:

{% set patternTitle = page.parent.title %}

:slight_smile:

1 Like

Bah. You’re right of course. I’m pretty sure that’s the only thing I hadn’t tried yet. Thanks for the nudge, Grav is my new goto now - love it. :slight_smile: