Hello, @texnixe I am using your Pages Display Section plugin.
I have a project.php model with:
<?php
class ProjectPage extends Page
{
public function getResources()
{
return site()->index()->filterBy('intendedTemplate', 'resource')->filter(fn ($resource) => $resource->project()->toPages()->has($this));
}
}
a project.yml blueprint with:
title: Project
options:
tabs:
# content tab
content:
label: Content
icon: text
columns:
- width: 4/4
sections:
resource:
headline: Related resources
type: pagesdisplay
query: page.getResources
image: page.cover.toFile
On this page in the panel, instead of displaying the “Resource” section, I get this error:
The section "resource" could not be loaded: Query result must be of type "Kirby\Cms\Pages", "Kirby\Cms\Field" given
And a resource.yml blueprint with:
title: Resource
tabs:
# content tab
content:
label: Content
icon: text
columns:
- width: 2/4
sections:
leftContents:
type: fields
fields:
project:
label: Related Projects
type: pages
query: site.children.template('projects').children.template('project')
help: This field allows for the selection of up to two related projects.
layout: cardlets
image: page.cover.toFile
I have used a similar set up on other sites, but I am not sure what I am doing wrong here. ![]()