src/Elements/Bundle/DemiFrontendBundle/Resources/views/Includes/connectedEntries.html.twig line 1

Open in your IDE?
  1. {% set maxEntries = maxEntries is defined ? maxEntries : 8 %}
  2. {% if connectedEntries | length >0 %}
  3.     <div class="title-block  title-block--centered  content-block container" >
  4.         <h2>{{ headline is defined ? headline : 'demi.connected-entries'|trans }}</h2>
  5.     </div>
  6.     <div class="justify-content-md-center row scrolling-row">
  7.         {% for index, entry in connectedEntries|slice(0,(maxEntries-1)) %}
  8.             {% if index is divisible by(4) %}
  9.     </div>
  10.     <div class="justify-content-md-center row scrolling-row">
  11.             {% endif %}
  12.             <div class="col-md-2 col-5 scrolling-row__item">
  13.                 <section class="img-teaser stretch-link teaser-animation" {{ editmode ? 'style="max-width: 400px;"' : '' }}>
  14.                     {% if entry['image'] is not empty %}
  15.                         {% set description = getImageDescription(entry['image']) %}
  16.                     {% endif %}
  17.                     <div class="img-teaser__embed embed-responsive">
  18.                         {% if entry['image'] is not empty %}
  19.                             {{ entry['image'].getThumbnail('img-teaser').getHtml({
  20.                                                                         'imgAttributes': {
  21.                                                                                 'class': 'js-lazy-img embed-responsive-item teaser-animation__img',
  22.                                                                                 'title': description|default(''),
  23.                                                                                 'alt': description|default('')}
  24.                             }) | raw }}
  25.                         {% endif %}
  26.                         {% do jsConfig().add('lazyImg', true) %}
  27.                     </div>
  28.                     <div class="{{ editmode ? '' : 'img-teaser__content' }}">
  29.                         <div>
  30.                             <div class="flatrate-teaser__badge">{{ ("demi.connectedEntry." ~ entry['type'])|trans }}</div>
  31.                             <h3 class="img-teaser__title h5">
  32.                                 <a class="stretch-link__link"
  33.                                    href="{{ entry['link'] }}">{{ entry['title']|raw }}</a>
  34.                             </h3>
  35.                         </div>
  36.                     </div>
  37.                 </section>
  38.             </div>
  39.         {% endfor %}
  40.     </div>
  41. {% endif %}