Hi guys,
I have a setup that needs routing/virtual pages (?)
requirements:
- set of pages located in:
/content/projects/[slug]
- the pages should be available in:
/work/[slug]
- multilingual (2 languages so far)
- the pages contain files
- the pages need a navigation. they need to know their siblings
I have tried with routing in the config.php
. No bingo so far.
'routes' => [
[
'pattern' => array(
'work/(:any)', // EN
'arbeiten/(:any)' // DE
),
'language' => '*',
'action' => function($language, $path) {
$originPage = kirby()->page('content/projects/'. $path);
if (!$originPage || $originPage->slug() !== $path) {
return false;
}
$data = [
'slug' => $originPage->slug('en'),
'parent' => page('work'),
'language' => $language,
'template' => 'page.project',
'files' => $originPage->files()->toArray()
'translations' => [
'en' => [
'code' => 'en',
'content' => $originPage->content('en')->toArray()
],
'de' => [
'code' => 'de',
'content' => $originPage->content('de')->toArray()
]
]
];
return Page::factory($data);
}
]
]
There is a problem with srcsets/thumb-creation and i am sure the pages cannot know their siblings (navigation not yet started).
What am i missing?