templates/PageParts/ObjectsPagePart/view.html.twig line 1

Open in your IDE?
  1. {% if resource.items is not empty %}
  2.     <section class="objects-pp">
  3.         <div class="object-overlay">
  4.             <div class="slick-arrows">
  5.                 <div>
  6.                     <button type="button" class="slick-prev slick-arrow" style=""><i class="fas fa-chevron-left"></i></button>
  7.                     <button type="button" class="slick-next slick-arrow" style=""><i class="fas fa-chevron-right"></i></button>
  8.                 </div>
  9.             </div>
  10.             <div class="object-box__text">
  11.                 <h2 role="heading" aria-level="2"><span>{{ resource.header | nl2br }}</span></h2>
  12.                 <a href="{{ resource.linkUrl|replace_url }}" class="btn btn--blue" {% if resource.linkNewWindow %}target="_blank" rel="noopener"{% endif %}>{{ resource.linkText }}</a>
  13.             </div>
  14.         </div>
  15.         <div class="objects-slider">
  16.             {% for item in resource.items | sortbyfield('displayOrder')  %}
  17.                 <div class="object-slide">
  18.                     <div class="object-box">
  19.                         <div class="object-box__text">
  20.                             <div class="object-name">
  21.                                 <a href="{{ item.linkUrl | replace_url }}" {% if item.linkNewWindow %} target="_blank" rel="noopener"{% endif %}>
  22.                                     {{ item.name }}
  23.                                 </a>
  24.                             </div>
  25.                         </div>
  26.                         <div class="object-box__img">
  27.                             {% set img = (item.image) ? item.image : null %}
  28.                             {% if img is null %}
  29.                                 {% set img = {
  30.                                     'url' : get_default_article_image(),
  31.                                     'mediaAlt' : 'GdyƄskie Centrum Sportu'
  32.                                 } %}
  33.                             {% endif %}
  34.                             {% if img is not null and img is not empty %}
  35.                                 {% set fullSrc = croppedImgSrc(img.url, item.cropping, { h: 630, w: 910, q: 80, fit: 'crop' }) %}
  36.                                 <a href="{{ item.linkUrl | replace_url }}" {% if item.linkNewWindow %} target="_blank" rel="noopener"{% endif %}>
  37.                                     <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid slice">
  38.                                         {% if item.imageAltText %}<title>{{ item.imageAltText }}</title>{% endif %}
  39.                                         <clipPath id="objectClip{{ item.id }}">
  40.                                             {#                                            <polygon points="0, 0, 0.97, 0, 0.83, 1.0, 0, 1.0"/>#}
  41.                                             <polygon points="100 0, 100 100, 40 100, 0 30, 20 0" />
  42.                                         </clipPath>
  43.                                         <image height="90%" width="100%" preserveAspectRatio="xMidYMid slice" clip-path="url('#objectClip{{ item.id }}')" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{{ fullSrc }}" />
  44.                                     </svg>
  45. {#                                    <img src="{{ glideUrl('webimages', img.url) }}{{ cropString }}" {% if item.imageAltText %}alt="{{ item.imageAltText }}"{% endif %} />#}
  46.                                 </a>
  47.                             {% endif %}
  48.                         </div>
  49.                     </div>
  50.                 </div>
  51.             {% endfor %}
  52.         </div>
  53.     </section>
  54. {% endif %}