Custom frontmatter not working

Hey there,

I just started playing with grav and ran into the following issue:

I have a file containing the following: (ignore the formatting, I had to push spaces before the lines because of the way code is declared on the forum :frowning: )
ā€” yaml

  title: Anticipation
  img: anticipation.jpg

and the following loop:
--- twig
<h1>Pictures</h1>
{% for p in page.collection('pictures') %}
    <article class="picture">
        <h2>{{ p.title }}</h2>
        {{ p.img }}
        <img src="/pictures/{{ p.title }}?resize={{site.thumbsize}}x{{site.thumbsize}}">
    </article>
{% endfor %}

But the output is:

ā€” html

Pictures

    <img src="/pictures/?resize=300x300">
</article>

I was under the impression that I don't need to specify custom front matter, am I wrong? How can I make this work?

img: anticipation.jpg is a Custom Page Header. Unfortunately you can not use Custom Page Headers in (exactly) the same way as Standard Page Headers like title.
For Standard Page Headers in Twig you can do: page.title while Custom Page Headers require: page.headers.img.

Thanks, that cleared things up for me, it is working with {{ p.header.img }}. :slight_smile: