-
-
Notifications
You must be signed in to change notification settings - Fork 158
/
select.html.twig
40 lines (33 loc) 路 1.33 KB
/
select.html.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{% extends '@bolt/_partials/fields/_base.html.twig' %}
{# On top of the attributes that get set/defined in `_base.html.twig`,
The Select fields has three additional attributes:
- options: The actual options that are available in the select
- multiple: A boolean to set whether or not we allow multiple selections
#}
{% if options is not defined %}
{% set options = select_options(field) %}
{% endif %}
{% if multiple is not defined %}
{% set multiple = field.definition.get('multiple')|default ? 'true' : 'false' %}
{% endif %}
{% if autocomplete is not defined %}
{% set autocomplete = field.definition.get('autocomplete')|default ? 'true' : 'false' %}
{% endif %}
{% if limit is not defined %}
{% set limit = field.definition.get('limit')|default(2000) %}
{% endif %}
{% block field %}
<editor-select
:classname="{{ ['wide-options ', class]|join|json_encode }}"
:value="{{ value|json_encode }}"
:name='{{ name|json_encode }}'
:id='{{ id|json_encode }}'
:options="{{ options|json_encode }}"
:optionslimit="{{ limit }}"
:form='{{ form|json_encode }}'
:multiple="{{ multiple }}"
:autocomplete="{{ autocomplete }}"
:readonly="{{ readonly|json_encode }}"
:errormessage='{{ errormessage|json_encode }}'
></editor-select>
{% endblock %}