Call hero image from parent blog page to post

Hi,

I need to show the hero image from blog main page in the children posts.
I can call the first image in the page media, with:

{% set page = page.find(’/news’) %}
{% set hero_image = page.media.images|first %}

But what I need is to call the selected image in the hero_image field.
The line below doesn’t work.

{% set hero_image = page.header.hero_image %}

What am i missing?..
Any help is appreciated.

Thanks
Pedro

You can try page.media.images[page.header.hero_image].

Nice, It worked!
Thank you @gnat !

Cheers!
Pedro

1 Like