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

Open in your IDE?
  1. {% if resource.items is not empty %}
  2.     <section class="projects-pp">
  3.         <div class="project-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="project-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="projects-slider">
  16.             {% for item in resource.items | sortbyfield('displayOrder')  %}
  17.                 <div class="project-slide">
  18.                     <div class="project-box">
  19.                         <div class="project-box__img">
  20.                             {% set img = (item.image) ? item.image : null %}
  21.                             {% if img is null %}
  22.                                 {% set img = {
  23.                                     'url' : get_default_article_image(),
  24.                                     'mediaAlt' : 'GdyƄskie Centrum Sportu'
  25.                                 } %}                                {% endif %}
  26.                             {% if img is not null and img is not empty %}
  27.                                 {% set fullSrc = croppedImgSrc(img.url, item.cropping, { h: 630, w: 910, q: 80, fit: 'crop' }) %}
  28.                                 <a href="{{ item.linkUrl | replace_url }}" {% if item.linkNewWindow %} target="_blank" rel="noopener"{% endif %}>
  29.                                     <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid slice">
  30.                                         {% if item.imageAltText %}<title>{{ item.imageAltText }}</title>{% endif %}
  31.                                         <clipPath id="projectClip{{ item.id }}">
  32. {#                                            <polygon points="0, 0, 0.97, 0, 0.83, 1.0, 0, 1.0"/>#}
  33.                                             <polygon points="0 0, 80 0, 100 30, 60 100, 0 100" />
  34.                                         </clipPath>
  35.                                         <image height="90%" width="100%" preserveAspectRatio="xMidYMid slice" clip-path="url('#projectClip{{ item.id }}')" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{{ fullSrc }}" />
  36.                                     </svg>
  37. {#                                    <img src="{{ glideUrl('webimages', img.url) }}{{ cropString }}" {% if item.imageAltText %}alt="{{ item.imageAltText }}"{% endif %} />#}
  38.                                 </a>
  39.                             {% endif %}
  40.                         </div>
  41.                         <div class="project-box__text">
  42.                             <div class="project-name">
  43.                                 <a href="{{ item.linkUrl | replace_url }}" {% if item.linkNewWindow %} target="_blank" rel="noopener"{% endif %}>
  44.                                     {{ item.name }}
  45.                                 </a>
  46.                             </div>
  47.                         </div>
  48.                     </div>
  49.                 </div>
  50.             {% endfor %}
  51.         </div>
  52.     </section>
  53. {% endif %}