This plugin currently doesn't feature multi language support. Title and help text can only be set for one language.
This plugin allows you to specify an icon select field in your blueprints.
- Put this entire folder in the
/site/plugins
directory of your kirby installation. - In line 7 of the
index.php
file in this directory adjust the path to the icons stored on your server you want to make selectable via this field.
Name | Type | Default | Description |
---|---|---|---|
help | String | - | Optional help text below the field. |
required | Boolean | false | If true, the field has to be filled in correctly to be saved. |
title | String | - | A simple string that is displayed above the field and that can be used to access it in templates/snippets. |
width | String | 1/1 | The width of the field in the field grid. Available widths: 1/1, 1/2, 1/3, 1/4, 2/3, 3/4 |
Simple Usage:
<?= $page->icon() ?>
Get the public URL to the Icon:
<?= $page->icon()->toIcon() ?>
You can use the output of the toIcon
method in an regular <img> Tag.
Alternatively, for more control over the icon and being able to edit it using CSS, you can use the PHP file_get_contents
method to embed the SVG itself.