Hi all,
I am currently testing this code snippet to extend the default panel search.
Kirby::plugin('example/search', [
'areas' => [
// extending a core search
'site' => function ($kirby) {
return [
'searches' => [
'pages' => [
'query' => function (string $query) use ($kirby) {
if (!$kirby->user()->isAdmin()) {
// return only child pages of a page (via specified UUID)
}
return $kirby->core()->area('site')['searches']['pages']['query']($query);
}
]
]
];
},
]
]);
However, “no result” appears in the search panel. How do you return the unchanged search results?
Background: I would like to customize the panel search so that the search is limited to different pages and their subpages for the user roles editor and reviewer.
Roland