Multiple custom routes

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 :frowning:

'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

Hey @chrfickinger! Try changing the order of your routes, or use $this->next() on the first to continue with the next route if the first doesn’t apply.

Hi Sonja,
that did not help, but I found the solution. The brackets were wrong.
Attached the solution, for someone who has possibly the same problem:

'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);
			}
        ]
    ]

Haha, totally overlooked that. It pays to always look closely :slightly_smiling_face: