samrm / translations
A translations section for kriby-3 panel
Installs: 190
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:kirby-plugin
Requires
- getkirby/cms: ^3.7 || ^4.0
- getkirby/composer-installer: ^1.1
README
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.
Installation
Download and copy this repository to /site/plugins/translations
Or install it with composer: composer require samrm/translations
Usage
To display the section in your page's panel, set your blueprint as follow :
sections:
translations:
headline: Translations
type: translations
PagesMethods
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.
PageMethods
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
Routing guards
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
]