I have two custom routes in my project. Both are working properly alone.
But by adding both to my config file, only the last one is working.
Am I mistakenly overwriting anything here ? I don’t get it
'routes' => [
[
// Add .panel to current frontend url to call panel of that page
'pattern' => '(:all).panel',
'language' => '*',
'action' => function($language, $id) {
if (kirby()->user() && $page = page($id)) {
go($page->panel()->url().'?language='.$language);
}
},
// Yearly News pages
'pattern' => '/news/(:num)',
'language' => '*',
'action' => function($language, $id) {
$data = [
'year' => $id,
];
return page('news')->render($data);
},
]
]
Thanks in advance for any help!
Chris