Hi, how could i add new parameters on panel routes navigation?
I would like to open a specific tab on some routes.
Had no look with the :before hook too.
Here is what I tried:
Kirby::plugin('router/queries', [
'hooks' => [
'panel.route:after' => function (Route $route, string $path, mixed $response) {
$query = http_build_query(array_merge($_GET, ['tab' => 'settings']));
$path = $path . '?' . $query;
// how to replace the route with new queries?
},
]
]);
I think you need a panel.route:before hook here, then use Panel::go() to redirect to the new location. Make sure to use conditions to make sure you can still reach other tabs.