Kirby Shortcode

It was a long time ago since I released a new plugin, but today is the day.


Kirbytags alternative

Kirby Shortcode is a powerful alternative to kirbytags, but it’s more similar to WordPress Shortcode API.

Kirbytags Shortcode
Self closing Yes Yes
Closing - Yes
Nesting - Yes
Any HTML - Yes
Access to $field Yes Yes
Access to $page Yes Yes

Kirbytags, markdown and HTML still works like before, even inside shortcodes.

Example content text


Some text.

[greetings firstname="Peter" lastname="Parker"]
    [hello] This is a tag inside a tag.
    Kirby *markdown* can be used inside a tag.
    Html can be <strong>used as well</strong>!
    Even kirbytags like (email: works.

Some more text.



c::set('plugin.shortcode.create', [
        'name' => 'hello',
        'text' => function() {
            return 'Hello world!';
        'name' => 'greetings',
        'text' => function($shortcode) {
            return sprintf(
                '**Greetings** %s %s!<br>%s',
        'name' => 'field-data',
        'text' => function($shortcode, $field) {
            return sprintf(
                '**Field key:** %s
                **Page title:** %s',

For more details, more on Github.

1 Like