xu-chris / kirby-editor-cta-block

Add a call-to-action button via the Kirby editor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CTA Block for the Kirby 3 Editor

The plugin provides a call-to-action button to the Kirby Editor.

References

Installation

Installation is currently only possible as file download or git submodule. If anyone wants to help with setting up a composer package, I'm more than happy to accept a pull request.

Note: You can also use a different name for plugin directory, but it needs to come after editor alphabetically.

Git Submodule

git submodule add https://github.com/creichel/kirby-editor-cta-block.git site/plugins/kirby-editor-cta-block

Download

  1. Download the source archive
  2. Unpack to site/plugins/kriby-editor-cta-block

Usage

Template

In your templates you can use the normal Editor integration:

<?= $page->text()->blocks() ?>

Customization

As with any Editor blocks, you can provide a custom snippet, so you can define how the file is rendered.

<a class="cta" data-action="button" data-title="<?= $content ?>" href="<?= $attrs->url() ?>" <?= $attrs->newwindow()->value() ? 'target="_blank"' : '' ?>>
    <?= $content ?>
</a>

License

This plugin is licensed under MIT

About

Add a call-to-action button via the Kirby editor

License:MIT License


Languages

Language:JavaScript 56.1%Language:PHP 29.6%Language:CSS 14.3%