sidekick-1.0.x-dev/templates/image-widget--default.html.twig

templates/image-widget--default.html.twig
{#
/**
 * @file
 * Theme override for an image field widget.
 *
 * Available variables:
 * - main_items: Main render elements of the 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.
 * - 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 at least one of the alt or title inputs is enabled and
 *   visible.
 *
 * @see template_preprocess_image_widget()
 */
#}
{% 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',
] %}
<div{{ attributes.addClass(classes).removeClass('clearfix') }}>
  <div class="form-managed-file__main">
    {{ main_items.filename }}
    {{ main_items|without('filename') }}
  </div>

  {% if has_meta or data.preview %}
    <div class="form-managed-file__meta-wrapper">
      <div class="form-managed-file__meta">
        {% if data.preview %}
          <div class="form-managed-file__image-preview image-preview">
            <div class="image-preview__img-wrapper">
              {{ data.preview }}
            </div>
          </div>
        {% endif %}

        {% if data.description or display or data.alt or data.title %}
          <div class="form-managed-file__meta-items">
            {{ data.description }}
            {% if display %}
              {{ data.display }}
            {% endif %}
            <div class="form--inline">
              {{ data.alt }}
              {% if data.sidekick %}
                {{ data.sidekick }}
              {% endif %}
            </div>
            {{ data.title }}
          </div>
        {% endif %}
      </div>
    </div>
  {% endif %}

  {# Every third-party addition will be rendered here. #}
  {{ data|without('preview', 'alt', 'title', 'description', 'display', 'sidekick') }}
</div>

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc