distantnative / Field Multiselect
Programming Languages
Labels
Projects that are alternatives of or similar to Field Multiselect
Multiselect Field for Kirby 2 CMS
The Multiselect field plugin introduces a select field type for the panel that allows you to choose multiple entries.
With the release of Kirby 3, this plugin has been archived and will not be maintained.
Requirements
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.
Installation & Update
Copy the files to site/plugins/field-multiselect/
.
Usage
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.
Limit how many options can be selected
You can use the special maxItems
and minItems
validators to add a minimum and/or a maximum number of selected options.
Example
related:
label: Related Articles
type: multiselect
search: true
options: query
query:
fetch: siblings
value: '{{id}}'
validate:
minItems: 1
maxItems: 10
Use Case: Related Pages
A great use for the multiselect field are related pages/articles. Just set up e.g. your blog 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 ?>
Version history
You can find a more or less complete version history in the changelog.
License
Author
Nico Hoffmann - https://nhoffmann.com