A simple tag for Kirby CMS which lets you output the current day. It's multi-language ready and it has some options.
Download the files and put them inside the site/plugins/today
folder. If the folder doesn't exist, create it.
Note: You can also put today.php
into your site/tags
folder. I recommend to use the site/plugins
folder, because you then can add it as Git Submodule.
If you are familiar with Git, you can clone this repository from Github to the /site/plugins/today
folder.
git clone https://github.com/roylodder/kirby-today.git site/plugins/today
Or you can use it as a Git Submodule.
git submodule add https://github.com/roylodder/kirby-today.git site/plugins/today
If you want this to work you'll need an multi-language instalation. You can use the Langkit of Kirby to get started. Add one or more translations to your files inside the site/language
folder. There already are some translations ready to use. Find them in the language folder inside this repository.
Example translation
l::set('monday', 'Monday');
l::set('tuesday', 'Tuesday');
l::set('wednesday', 'Wednesday');
l::set('thursday', 'Thursday');
l::set('friday', 'Friday');
l::set('saterday', 'Saterday');
l::set('sunday', 'Sunday');
In your text file you can use it as follows:
Enjoy the rest of your (today:)!
if it's a Monday, then the result is:
Enjoy the rest of your Monday!
You can transform the text to UPPERCASE or lowercase by using the options. The default option will use the exact format of the translation.
Uppercase: (today: upper)
Lowercase: (today: lower)
Default: (today:)
Author: Roy Lodder http://roylodder.com Contributor: Philippe Gervaise https://github.com/malvese