How can I use the Quickselect field and limit the options to only the sub-pages it the page ‘projects’? I’ve attempted what I thought could work but I don’t think I’m close, any help would be greatly appreciated.
home.yml
linkpage:
label: Linked Project
type: relationship
controller: FieldQuery::queryprojects
placeholder: Choose an Project
plugins/myfieldqueries/myfieldqueries.php
<?php
class FieldQuery {
static function queryprojects($field) {
$kirby = kirby();
$site = $kirby->site();
$projects = $site->find('projects')->children()->visible();
return $projects;
}
}