{% extends default ? "partials/field.html.twig" : 'forms/' ~ layout|default('field') ~ '.html.twig' %}

{% block input %}
    <div class="settings-block"><div class="settings-param-field"><div class="input-group">
    {% set label = field.picker_label|default('GANTRY5_PLATFORM_PICK_PARTICLE'|trans) %}
    {% set alt_label = field.picker_label_alt|default('GANTRY5_PLATFORM_EDIT_PARTICLE'|trans) %}
    <span class="g-instancepicker-title">{{ value.title|default('') }}</span><button class="button" data-g-instancepicker="{{ { type: 'particle', field: (scope ~ name)|fieldName|e }|json_encode|e('html_attr') }}" data-g-instancepicker-text="{{ label }}" data-g-instancepicker-alttext="{{ alt_label }}">{{ value ? alt_label : label }}</button>
    <input
            type="hidden"
            name="{{ (scope ~ name)|fieldName|e }}"
            value="{{ value ? value|json_encode(constant('JSON_UNESCAPED_UNICODE'))|e }}"
            {# global attribute structures #}
            {{ block('global_attributes') }}
            {# non-gloval attribute structures #}
            {% if field.disabled in ['on', 'true', 1] %}disabled="disabled"{% endif %}
            {% if field.required in ['on', 'true', 1] %}required="required"{% endif %}
            />

    <span class="g-reset-field" data-g-reset-field="{{ (scope ~ name)|fieldName|e }}"><i class="fa  fa-fw fa-times-circle"></i></span>
    </div></div></div>
{% endblock %}
