Is there a way to display entries from a structure field from page A on page B in the panel?
The entries on page B don’t have to be editable, they would just be information.
If the entries on page A are changed they should also update on page B.
Thanks a lot already
Played around with the query language and a custom page method and came up with a solution that works for my case. So pageA is the list and now even on multiple pageB’s I can show the entries I want filtered by a field name. Probably there is a much more elegant way to do it though
– but in case anybody can use it:
Page method:
Kirby::plugin('my/pagemethods', [
'pageMethods' => [
'list' => function() {
$pageB = $this->slug();
foreach($this->kirby()->site()->find('pageA')->structurefield()->toStructure()->sortBy(...)->filterBy('field4', '==', $pageB) as $entry) {
$field1 = $entry->field1()->toString();
$field2 = $entry->field2()->toString();
$field3 = $entry->field3()->toString();
$list[] = $field1 . ' ' . $field2 . ' ' . $field3;
}
return $list = implode("\n", $list);
},
]
]);
Blueprint for pageB:
info:
label: Info
type: info
text: "{{ page.list }}"