Pages field, image preview

Hello, I have a pages field that successfully pulls pages based on the template. By default Kirby pulls the first image in the folder as a preview. I would like to change the preview image to a image that may not be the first image on the page. I have a single image field on the pages that are being pulled. The name of the field is “pg_preview”. I’m not sure how to use this image setting that I see in the doc…

image: page.image.findBy("name", "cover")

Do I do something like

image: page.image.findBy("pg_preview", "cover")

Maybe that’s just trying to find an image on the current page with a field name of ‘pg_preview’?

Please advise.

image: page.pg_preview.toFile()

Your query has to return an image object.

1 Like

Wonderful. Done. Thanks @texnixe