claro-8.x-1.x-dev/templates/content-edit/image-widget.html.twig
templates/content-edit/image-widget.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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | {# /** * @file * Theme override for an image field widget. * * Available variables: * - attributes: HTML attributes for the containing element. * - data: Render elements of the image widget. * - 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 an image. * - has_meta: true when one of the title or alt inputs are enabled and visible. * * @see template_preprocess_image_widget() * @see stable_preprocess_image_widget() * @see claro_preprocess_image_widget() */ #} {% set classes = [ 'form-managed-file--image' , multiple ? 'is-multiple' : 'is-single' , upload ? 'has-upload' : 'no-upload' , has_value ? 'has-value' : 'no-value' , has_meta ? 'has-meta' : 'no-meta' , data.preview ? 'has-preview' : 'no-preview' , ] %} <div{{ attributes.addClass(classes).removeClass( 'clearfix' ) }}> <div class = "form-managed-file__main" > {{ data|without( 'preview' , 'alt' , 'title' )}} </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.alt or data.title %} <div class = "form-managed-file__meta-items" > {% endif %} {{ data.alt }} {{ data.title }} {% if data.alt or data.title %} </div> {% endif %} </div> </div> {% endif %} </div> |