Hi Kirby Lovers
This question is here; Question concerning the Blog in Kirby 3.5.1
I was wondering if I could use the features of the blog (e.g. tags, categories, summaries, rendering all blog entries together on a page) and yet create a different url?
More explicitely:
Instead of my-site.com/blog/entry
Create my-site.com/entry
There are 3 language DE,EN,TR and DE is main language. I removed “filme, Musik and texte” from url for all languages but when you click language menu then “Home” page doesn’t load. You can check here; https://nedimhazar.de/demo/
Could you please help me how can do correctly this routing?
'routes' => [
[
'pattern' => '(:any)',
'action' => function($uid) {
$page = page($uid);
if(!$page) $page = page('filme/' . $uid);
if(!$page) $page = page('musik/' . $uid);
if(!$page) $page = page('texte/' . $uid);
if(!$page) $page = site()->errorPage();
return site()->visit($page);
}
],
[
'pattern' => ['filme/(:any)', 'musik(:any)', 'texte(:any)'],
'action' => function($uid) {
go($uid);
}
],
[
'pattern' => '(:any)',
'language' => 'en',
'action' => function($language, $uid) {
$page = page($uid);
if(!$page) $page = page('films/' . $uid);
if(!$page) $page = page('music/' . $uid);
if(!$page) $page = page('articles/' . $uid);
if(!$page) $page = site()->errorPage();
return site()->visit($page, $language);
}
],
[
'pattern' => ['films/(:any)', 'music/(:any)', 'articles/(:any)'],
'language' => 'en',
'action' => function($language, $uid) {
go($language. '/' . $uid);
}
],
[
'pattern' => '(:any)',
'language' => 'tr',
'action' => function($language, $uid) {
$page = page($uid);
if(!$page) $page = page('filmler/' . $uid);
if(!$page) $page = page('muzik/' . $uid);
if(!$page) $page = page('makaleler/' . $uid);
if(!$page) $page = site()->errorPage();
return site()->visit($page, $language);
}
],
[
'pattern' => ['filmler/(:any)', 'muzik/(:any)', 'makaleler/(:any)'],
'language' => 'tr',
'action' => function($language, $uid) {
go($language. '/' . $uid);
}
]
],
Regards