templates/includes/blocks/teaser.html.twig line 1

  1. {% set propertyName = propertyName|default('blocks') %}
  2. {% set count = content.teaser_list|length %}
  3. <div class="teaser-wrapper teaser-{{ content.teaser_design|default('blue') }}">
  4.     {% if parent.type is not defined  %}
  5.     {% endif %}
  6.         <div class="grid-x small-up-1
  7.             {% if count > 1 %}large-up-2{% endif%}
  8.             {% if count > 2 %}large-up-3{% endif%}
  9.             {% if count > 3 %}large-up-4{% endif%}
  10.             g-4
  11.             {{ (parent.column_alignment_left is not defined and parent.column_alignment_right is not defined) ? " mb-3" : "" }}">
  12.             {% for teaser in content.teaser_list %}
  13.                 <div class="cell">
  14.                     <div class="teaser card grid-y align-middle align-justify bg-{{ content.teaser_design|default('blue') }}">
  15.                         {% if teaser.headline or teaser.subline %}
  16.                             <div class="card-body grid-y align-middle align-top">
  17.                                 {% if teaser.image %}
  18.                                     {% set media = sulu_resolve_media(teaser.image, app.request.locale) %}
  19.                                     <img src="{{ media.thumbnails[(teaser.image_format) ? teaser.image_format : "square"] }}"
  20.                                          class="card-img-top {{ (teaser.image_format == "icon") ? "svgimage" : "" }} image-{{ content.teaser_design|default('blue') }}"
  21.                                          {% autoescape false %}alt="{{ teaser.headline|default('')|pipe|nl2br|hyphenate }}"{% endautoescape %}
  22.                                             {% if teaser.image_format == "icon" %}style='max-width: 100px;'{% endif %}
  23.                                             {% if teaser.image_format == "squarehalf" %}style='max-width: 50%;'{% endif %}
  24.                                     />
  25.                                 {% endif %}
  26.                                 {% autoescape false %}
  27.                                     {% if teaser.subline %}
  28.                                         <h6 class="card-title my-3">{{ teaser.subline|default('')|pipe|nl2br|hyphenate }}</h6>
  29.                                     {% endif %}
  30.                                     {% if teaser.headline %}
  31.                                         <h5 class="mb-0">{{ teaser.headline|default('')|pipe|nl2br|hyphenate }}</h5>
  32.                                     {% endif %}
  33.                                 {% endautoescape %}
  34.                                 {% if teaser.text %}
  35.                                     <div class="{{ (teaser.link) ? 'pb-3' : '' }} text-center">
  36.                                         {{ teaser.text|raw }}
  37.                                     </div>
  38.                                 {% endif %}
  39.                             </div>
  40.                         {% endif %}
  41.                         {% if teaser.link or teaser.text %}
  42.                             <div class="card-footer bg-{{ content.teaser_design|default('blue') }}">
  43.                                 {% if teaser.link %}
  44.                                     <a class="button-wrapper pt-0" href="{{ teaser.link }}" target="{{ view.teaser_list[loop.index0].link.target|default("_self") }}" rel="{{ view.teaser_list[loop.index0].link.provider|default("page") }}">
  45.                                         <span class="btn btn-primary">
  46.                                             {{ view.teaser_list[loop.index0].link.title|default("Mehr erfahren") }}
  47.                                         </span>
  48.                                     </a>
  49.                                 {% endif %}
  50.                             </div>
  51.                         {% endif %}
  52.                     </div>
  53.                 </div>
  54.             {% endfor %}
  55.         </div>
  56.         {% if parent.type is not defined  %}
  57.         {% endif %}
  58. </div>