Creating a Related Pages panel item for a 'Read Next' section after blog post detail page

Hi there, I’m following the related articles post in the cookbook trying to create a page picker panel in the sidebar when editing a blog post, that lets me choose other published blog posts (articles) on my site.

I’ve added:

    type: pages
    query: page.siblings(false)
    empty: "No read next pages selected"

to the foot of my article.yml (which I use for blog posts)

However it only ever shows an add button which prompt me to add a page, not select a sibling blog post.

How can I change this to allow me to select other posts within the same parent folder? or even any page on the side - I don’t mind).

adding the following manually to a specific blog post interestingly doesn’t make anything show in the admin


- bear-notes-post.png



- journal/making-remote-work-work
- journal/eliminating-distractions-as-a-generalist

or in my frontend template using the following in the template

$related = $page->related()->toPages();

…which makes me think my query is wrong.

Any suggestions as to where I’m going wrong? Articles live in a journal folder e.g. and there’s nothing else called related inside my article.yml file.

Thanks!! Al

Looks like you created a pages section rather than a pages field. If you can’t figure it out yourself, please post your blueprint.

1 Like

Thanks @pixelijn - that put me on the right track. My confusion was I’d put it under the gallery entry, instead of under fields, and shifting it up so it was in the fields list and indenting in a few levels did the trick.

Posting what worked below in-case it helps someone else. Thanks again. :heart:

width: 1/3
    type: fields
        label: Cover Image
        type: files
        headline: Cover
        layout: cards
        info: "{{ file.dimensions }}"
        template: cover
        min: 0
        max: 1

        label: Related Pages
        type: pages
        query: page.siblings(false)
        empty: "No read next pages selected"

    type: files
    layout: cards