{# /** * @file * Theme override to display a file form widget. * * Available variables: * - main_items: Main render elements of the file or image widget: * file name, upload input, upload and remove buttons and hidden inputs. * - data: Other render elements of the image widget like preview, alt or title, * or the description input and the display checkbox of the file widget. * - display: A flag indicating whether the display field is visible. * - attributes: HTML attributes for the containing element. * - multiple: Whether this widget is the part of a multi-value file widget or * not. * - upload: Whether the file upload input is displayed or not. * - has_value: true if the widget already contains a file. * - has_meta: true when the display checkbox or the description, alt or title * inputs are enabled and at least one of them is visible. * * @see template_preprocess_file_managed_file() * @see claro_preprocess_file_managed_file() */ #} {% set classes = [ 'js-form-managed-file', 'form-managed-file', multiple ? 'is-multiple' : 'is-single', upload ? 'has-upload' : 'no-upload', has_value ? 'has-value' : 'no-value', has_meta ? 'has-meta' : 'no-meta', ] %}
{{ main_items.filename }} {{ main_items|without('filename') }}
{% if has_meta or data.preview %}
{% if data.preview %}
{{ data.preview }}
{% endif %} {% if data.description or display or data.alt or data.title %}
{{ data.description }} {% if display %} {{ data.display }} {% endif %} {{ data.alt }} {{ data.title }}
{% endif %}
{% endif %} {# Every third-party addition will be rendered here. #} {{ data|without('preview', 'alt', 'title', 'description', 'display') }}