Hi, for a plugin I want to use virtual pages in a multilanguage Setup. At the moment in the registration of the Plugin some of the basic virtual pages are generated.
Minimal example of the index.php:
<?php
function generatePages($kirby){
$customPage = new ShopPage([
"slug" => "mypage",
"template" => "default",
"content" => [
"title" => "Meine Seite",
]
]);
return $customPage;
}
Kirby::plugin("myPlugin", [
"pageModels" => [
"mypage" => MyPage::class,
"mychildpage" => MyChildPage::class
],
"pages" => generatePages(kirby()),
"translations" => [
"en" => [
// some english translations
],
"de" => [
// some german translations
],
]
The page is not showing up in the filesystem, thats ok for me, but now I want to add the english title.
I know that I can use $customPage->changeTitle('new Titel', 'en);
, but that needed permissions and if I use $kirby->impersionate('kirby')
only the translated page show up in the filesystem.
So what is the best way to add other languages?
Or is it possible to give the language directly in the constructor of the page?