mirror of
https://github.com/jbcr/core.git
synced 2026-04-25 09:38:08 +02:00
34 lines
1.1 KiB
Twig
34 lines
1.1 KiB
Twig
{% 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
|
|
- allowempty: A boolean to set whether or not we allow clearing the selection
|
|
#}
|
|
|
|
{% if options is not defined %}
|
|
{% set options = selectOptions(field) %}
|
|
{% endif %}
|
|
|
|
{% set multiple = field.definition.get('multiple')|default ? 'true' : 'false' %}
|
|
|
|
{% if allowempty is not defined and field.definition|default %}
|
|
{% set allowempty = field.definition.get('allowempty') ? 'true' : 'false' %}
|
|
{% else %}
|
|
{% set allowempty = allowempty|default ? 'true' : 'false' %}
|
|
{% endif %}
|
|
|
|
{% block field %}
|
|
<editor-select
|
|
:value="{{ value|json_encode }}"
|
|
:name='{{ name|json_encode }}'
|
|
:id='{{ id|json_encode }}'
|
|
:options="{{ options|json_encode }}"
|
|
:form='{{ form|json_encode }}'
|
|
:multiple="{{ multiple }}"
|
|
:allowempty="{{ allowempty }}"
|
|
></editor-select>
|
|
{% endblock %}
|