Hi there. I just start exploring Kirby and so far I really love it, but…
I’m stuck on a really basic thing (i suppose). I think I’ve must understand something wrong.
To the point. I have multilanguage site with folder ‘pages’ which include basic pages like ‘about’ and ‘contact’. That’s give me urls eg ‘en/pages/about’ and ‘de/pages/about’. I would like to remove ‚pages’ part and leave only ‘en/about’ and ‚‘de/about’. I read the docs and the forum, but answers i found there doesn’t work, or partially work, or like I said earlier, my understending is wrong I thought that if i change url method in model to:
public function url($options = null): string
{
return $this->kirby()->url('base') . '/' . $this->slug();
}
it change url on the front side, but it changed only url of a button to preview page.
On the other hand, when i try to change url’s via config.php using
'routes' => [
[
'pattern' => '(:any)',
'action' => function($uid) {
$page = page($uid);
if(!$page) $page = page('pages/' . $uid);
if(!$page) $page = site()->errorPage();
return site()->visit($page);
}
],
[
'pattern' => 'pages/(:any)',
'action' => function($uid) {
go($uid);
}
]
]
it’s not working proper with languages and not changing the preview button url.
Does it mean that, urls on the website can only be changed via config file or am i doing something wrong?
Can you help me with that?