A translations section to switch beween page's languages in Kirby-3 panel.
This section adds and manages a translated
status on its page, set to true
or false
.
It is usefull to keep an overview on a page's translations.
Download and copy this repository to /site/plugins/translations
Or install it with composer: composer require samrm/translations
To display the section in your page's panel, set your blueprint as follow :
sections:
translations:
headline: Translations
type: translations
This plugins goes withs the following PagesMethods :
-
$pages->translated()
to get thetranslated
pages for the current language. -
$pages->available()
to get thetranslated
andvisible
pages for the current language.
This plugins goes withs the following PageMethods :
-
$page->isTranslated()
to check if the page current translation's status istrue
-
$page->isUntranslated()
to check if the page current translation's status is nottrue
-
$page->isAvailable()
to check if the page current translation's status istrue
, and if the page isvisible
-
$page->isUnavailable()
to check if the page current translation's status is nottrue
, or if the page is notvisible
This plugin comes with a builtin naviguation guard that protects unavailable pages translations.
To enable it, set your config as follow :
return [
'samrm.translations.routing' => true
]