Download the PHP package genxbe/k3-fragments without Composer
On this page you can find all versions of the php package genxbe/k3-fragments. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download genxbe/k3-fragments
More information about genxbe/k3-fragments
Files in genxbe/k3-fragments
Package k3-fragments
Short Description Kirby3 plugin to make it possible to use translated strings that can be easily translated in the panel.
License MIT
Informations about the package k3-fragments
Kirby3 Fragments
Kirby3 Fragments is a small string/translation helper. You can use fragments in your code 'laravel/blade' style and optionally translate them on site or page level. Additionaly you can pass placeholders to the fragment.
A perfect solution for translation of static labels etc... But can also be used to make other 'static' content manageable via the CMS.
Syntax
__(string $fragment, array $placeholders = [])
-
$fragment : Can be any string or label, you can either choose to use 'Firstname' or rather work with 'label.firstname'. Whichever you prefer.
- $placeholders : Kirby style placeholders (See Str::template() for more information)
Usage
-
Add Fragment blueprint to site and/or page to blueprint
-
Use k3-fragments string helper in code
-
Translate or change content via panel
- If both Site and Page translations exist k3-fragments will give priority to the page translation (this way you can overwrite site fragments on a page level) Although it's not required that fragments exist on both levels.

Plugin installation
Download
Download and copy this repository to /site/plugins/k3-fragments.
Git submodule
Composer
License
MIT