Hey,
i have a multi-language site (de & en). I need some routing to simplify the urls. But it seems that the language scope is ignored. I want a route just for the german and a route for the english pages.
I also run in the problem, that with these kind of routes the english home page is getting a 404.
Here is a little example of the page structure:
Lang Panel Live
----- ----- ----
DE / / Startseite (DE)
DE /gesicht /gesicht
DE /gesicht/gesicht-sub-page /gesicht-sub-page
EN /en /en Startseite (EN)
EN /face /face
EN /face/face-sub-page /face-sub-page
Here is my current try for the routing. It works only for DE, but not for EN:
[
'pattern' => '(:any)',
'language' => 'de',
'action' => function ($uid) {
$page = kirby()->page($uid);
if (!$page) $page = page('gesicht/' . $uid);
if (!$page) $page = site()->errorPage();
return site()->visit($page);
}
],
[
'pattern' => '(:any)',
'language' => 'en',
'action' => function ($uid) {
$page = kirby()->page($uid);
if (!$page) $page = page('face/' . $uid);
if (!$page) $page = site()->errorPage();
return site()->visit($page);
}
],
Any help would be appreciated
Thanks – Matthias