The Multiselect field plugin introduces a select field type for the panel that allows you to choose multiple entries.
The plugin is free, but I would appreciate it if you would support me with a moral license!
Since version 1.0.0 the multiselect field requires Kirby CMS 2.3 or higher.
If you are running an older version of Kirby, please use version 1.4.0 of the multiselect field.
Copy the files to site/plugins/field-multiselect/
.
Use it in your blueprint:
bestband:
label: Best Band Ever
type: multiselect
required: true
search: true
options:
1d : 1Direction
bb: BBoys
aq: Aqua
vb: Vengaboys
fr: Freiheit
o3: OH!O
mi: Miley
bi: Bieber
u2: U2
Result:
It can also be used with the usual field options (pages etc.) of the checkboxes field.
A great use for the multiselect field are related pages/articles. Just set up e.g. your glog article blueprint as follows:
related:
label: Related Articles
type: multiselect
search: true
options: query
query:
fetch: siblings
value: '{{id}}'
And then use them in your template:
<?php foreach($page->related()->pages(',') as $related): ?>
…
<?php endforeach ?>
You can find a more or less complete version history in the changelog.
Nico Hoffmann - https://nhoffmann.com