A collection of little helper for usage in Kirby
kirby plugin:install fanningert/kirbycms-extension-webhelper
Go into the {kirby_installation}/site/plugins
directory and execute following command.
$ git clone https://github.com/fanningert/kirbycms-extension-webhelper.git
Go in the root directory of your git repository and execute following command to add the repository as submodule to your GIT repository.
$ git submodule add https://github.com/fanningert/kirbycms-extension-webhelper.git ./site/plugins/kirbycms-extension-webhelper
$ git submodule init
$ git submodule update
kirby plugin:update fanningert/kirbycms-extension-webhelper
Go into the {kirby_installation}/site/plugins/kirbycms-extension-webhelper
directory and execute following command.
$ git pull
Go in the root directory of your git repository and execute following command to update the submodule of this extension.
$ git submodule update
- All function: Add config parameter to selectiv activate a function (KirbyTag)
- Function
age
: Add optional Attributes for dateformat and timezone - Function
messagebox
: Add config parameter to define the the prefix for class (Default:alert
)
Generel the tags works in two versions.
Simple tag
(message_type: text)
Complex tag
(message_type)
text
(/message_type)
(info: This is an important information.)
$text = "This is an important information.";
at\fanninger\kirby\extension\webhelper\WebHelper::messageboxInformation( $text );
<div class="alert alert-info">This is an important information.</div>
(success: Hooooray! This messages says that operation succeeded!!)
$text = "Hooooray! This messages says that operation succeeded!!";
at\fanninger\kirby\extension\webhelper\WebHelper::messageboxSuccess( $text );
<div class="alert alert-success">Hooooray! This messages says that operation succeeded!!</div>
(warning: Now this is a warning! One more click and you`ll face the consequences!)
$text = "Now this is a warning! One more click and you`ll face the consequences!";
at\fanninger\kirby\extension\webhelper\WebHelper::messageboxWarning( $text );
<div class="alert alert-warning">Now this is a warning! One more click and you`ll face the consequences!</div>
(error: Oooops, this is an error message. You know what that means.)
$text = "Oooops, this is an error message. You know what that means.";
at\fanninger\kirby\extension\webhelper\WebHelper::messageboxError( $text );
<div class="alert alert-error">Oooops, this is an error message. You know what that means.</div>
(validation: First name is a required field)
$text = "First name is a required field";
at\fanninger\kirby\extension\webhelper\WebHelper::messageboxValidation( $text );
<div class="alert alert-validation">First name is a required field</div>
(figure caption: text)
content
(/figure)
Output
<figure>
content
<figcaption>text</figcaption>
</figure>
(figure: text caption_top: true class: test-class)
content
(/figure)
Output
<figure class="test-class">
<figcaption>text</figcaption>
content
</figure>
(age: 21/01/1972)
$dayOfBirth = '21/01/1972';
$dateFormat = 'd/m/Y'; //Optional
$timezone = 'Europe/Brussels'; //Optional
at\fanninger\kirby\extension\webhelper\WebHelper::calcAge($dayOfBirth, $dateFormat, $timezone);