Hey there,
I switched from 3 to 4 (wonderful) but Iām facing a small issue where the custom images I used for the cards layout with the page section
are not working properly anymore :
<?php
class AboutPage extends Page
{
public function previewImage(): Pages
{
if ($image = $this->images()->first()) {
return $image;
}
if (file_exists(kirby()->root('assets') . "/images/about.jpg")) {
return new Asset("assets/images/about.jpg");
}
return false;
}
}
This code used to work before 4. I added : Pages at the end since it generated a bug with the focus somehow. But now no images are being shown as they used to. My blueprint looks like that :
title: Site
tabs:
content:
label: Content
icon: text
sections:
pages:
type: pages
layout: cards
status: listed
image:
query: page.previewImage
cover: true
size: medium
seo: seo/site