src/Trinity/BlogBundle/Resources/views/default/slider.html.twig line 1

Open in your IDE?
  1. {% trans_default_domain 'blog' %}
  2. {% if file_exists('../templates/override/blog/slider.html.twig') %}
  3.   {% include 'override/blog/slider.html.twig' %}
  4. {% else %}
  5.   {% trans_default_domain 'blog' %}
  6.   {% if config.uri is defined and config.uri is not empty %}
  7.     {% set baseUrl_detail = path('homepage') ~ config.uri %}
  8.   {% else %}
  9.     {% set baseUrl_detail = path(app.request.attributes.get('_route')) %}
  10.   {% endif %}
  11.   {% if config.uri_overview is defined and config.uri_overview is not empty %}
  12.     {% set baseUrl = path('homepage') ~ config.uri_overview %}
  13.   {% else %}
  14.     {% set baseUrl = path(app.request.attributes.get('_route')) %}
  15.   {% endif %}
  16.   <div class="blog">
  17.     <div class="swiper-content">
  18.       <div class="swiper-container swiper-blog">
  19.         <div class="swiper-wrapper">
  20.             {% for Entry in entries %}
  21.                 {% if Entry.isexternal and Entry.externalurl is not empty %}
  22.               {% set detailUrl = Entry.externalurl %}
  23.             {% else %}
  24.               {% set detailUrl = baseUrl_detail ~ '/' ~ Entry.id ~ '/' ~ Entry.getDefaultSlug %}
  25.             {% endif %}
  26.             {% set shareUrl = url(app.request.attributes.get('_route')) ~ '/' ~ Entry.id ~ '/' ~ Entry.getDefaultSlug %}
  27.             {% if Entry.slug and Entry.isexternal == false %}
  28.               {% set detailUrl = baseUrl_detail ~ '/' ~ Entry.getSlug %}
  29.               {% set shareUrl = url(app.request.attributes.get('_route')) ~ '/' ~ Entry.getSlug %}
  30.             {% endif %}
  31.             <div class="swiper-slide">
  32.               <div class="item {{config['minimal'] is defined and config['minimal'] == '1' ? 'minimal' : 'card'}}">
  33.                 <a href="{{detailUrl}}" {% if Entry.isexternal and Entry.externalurl is not empty %}target="_blank"{% endif %}>
  34.                   <div class="heightfix">
  35.                     {% if config['minimal'] is not defined or config['minimal'] == '0' %}
  36.                       <div class="thumb">
  37.                         <div class="lcp image">
  38.                           {% if Entry.media and Entry.media.first and Entry.media.first.hasBlurred %}
  39.                             <picture>
  40.                               {% if Entry.media and Entry.media.first %}
  41.                                 {% if Entry.media.first.hasWebp() %}
  42.                                   <source srcset="/{{Entry.media.first.getBlurredWebpPath('small')}}" type="image/webp">
  43.                                 {% endif %}
  44.                                 <source srcset="/{{Entry.media.first.getBlurredWebPath}}('small')" type="{{Entry.media.first.mime}}">
  45.                                 <img class="lq" alt="{{Entry.media.first.description_alt}}" src="/{{Entry.media.first.getBlurredWebPath('small')}}" type="{{Entry.media.first.mime}}" loading="lazy" width="{{Entry.media.first.width}}" height="{{Entry.media.first.height}}">
  46.                               {% elseif Entry.image %}
  47.                                 {% if Entry.image.hasWebp() %}
  48.                                   <source srcset="/{{Entry.image.getBlurredWebpPath('small')}}" type="image/webp">
  49.                                 {% endif %}
  50.                                 <source srcset="/{{Entry.image.getBlurredWebPath('small')}}" type="{{Entry.image.mime}}">
  51.                                 <img class="lq" alt="{{Entry.image.description_alt}}" src="/{{Entry.image.getBlurredWebPath('small')}}" type="{{Entry.image.mime}}" loading="lazy" width="{{Entry.image.width}}" height="{{Entry.image.height}}">
  52.                               {% endif %}
  53.                             </picture>
  54.                           {% endif %}
  55.                           <picture>
  56.                             {% if Entry.media and Entry.media.first %}
  57.                               {% if Entry.media.first.hasWebp() %}
  58.                                 <source srcset="/{{Entry.media.first.getWebpPath('medium')}}" type="image/webp">
  59.                               {% endif %}
  60.                               <source srcset="/{{Entry.media.first.getWebPath('medium')}}" type="{{ Entry.media.first.mime }}">
  61.                             <img class="hq" alt="{{Entry.media.first.description_alt}}" src="/{{Entry.media.first.getWebPath('medium')}}" type="{{Entry.media.first.mime}}" loading="lazy" width="{{Entry.media.first.width}}" height="{{Entry.media.first.height}}" onload="this.style.opacity=1{% if Entry.media.first.hasBlurred %};this.closest('.lcp').getElementsByClassName('lq')[0].style.opacity=0;{% endif %}" style="opacity: 0;">
  62.                             {% elseif Entry.image %}
  63.                               {% if Entry.image.hasWebp() %}
  64.                                 <source srcset="/{{Entry.image.getWebpPath('medium')}}" type="image/webp">
  65.                               {% endif %}
  66.                               <source srcset="/{{Entry.image.getWebPath('medium')}}" type="{{ Entry.image.mime }}">
  67.                             <img class="hq" alt="{{Entry.image.description_alt}}" src="/{{Entry.image.getWebPath('medium')}}" type="{{Entry.image.mime}}" loading="lazy" width="{{Entry.image.width}}" height="{{Entry.image.height}}" onload="this.style.opacity=1{% if Entry.media.first.hasBlurred %};this.closest('.lcp').getElementsByClassName('lq')[0].style.opacity=0;{% endif %}" style="opacity: 0;">
  68.                             {% endif %}
  69.                           </picture>
  70.                         </div>
  71.                       </div>
  72.                       <div class="content">
  73.                         <h3>
  74.                           {{Entry.label}}
  75.                         </h3>
  76.                         {% if config['nodate'] is not defined %}
  77.                           <span class="date">
  78.                             {{Entry.datePublish|timeago}}
  79.                           </span>
  80.                         {% endif %}
  81.                       </div>
  82.                     {% else %}
  83.                       <div>
  84.                         {% if config['nodate'] is not defined %}
  85.                           <div class="date">{{Entry.datePublish|timeago}}</div>
  86.                         {% endif %}
  87.                         <a href="{{detailUrl}}">{{Entry.label}}</a>
  88.                       </div>
  89.                     {% endif %}
  90.                   </div>
  91.                 </a>
  92.                 {# {% if config['sharinglist'] is defined and config['sharinglist'] is not empty %}
  93.                   <div class="share">
  94.                     <span class="label">{{'Delen:'|trans}}</span>
  95.                     <!-- Sharingbutton Facebook -->
  96.                     <a class="resp-sharing-button__link" href="https://facebook.com/sharer/sharer.php?u={{shareUrl}}" target="_blank" title="Facebook" aria-label="">
  97.                       <div class="resp-sharing-button resp-sharing-button--facebook resp-sharing-button--small">
  98.                         <div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid">
  99.                           <svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24"><path d="M18.77 7.46H14.5v-1.9c0-.9.6-1.1 1-1.1h3V.5h-4.33C10.24.5 9.5 3.44 9.5 5.32v2.15h-3v4h3v12h5v-12h3.85l.42-4z"/></svg>
  100.                         </div>
  101.                       </div>
  102.                     </a>
  103.                     <!-- Sharingbutton Twitter -->
  104.                     <a class="resp-sharing-button__link" href="https://twitter.com/intent/tweet/?text={{Entry.label}}&amp;url={{shareUrl}}" target="_blank" title="Twitter" aria-label="">
  105.                       <div class="resp-sharing-button resp-sharing-button--twitter resp-sharing-button--small">
  106.                         <div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid">
  107.                           <svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24"><path
  108.                             d="M23.44 4.83c-.8.37-1.5.38-2.22.02.93-.56.98-.96 1.32-2.02-.88.52-1.86.9-2.9 1.1-.82-.88-2-1.43-3.3-1.43-2.5 0-4.55 2.04-4.55 4.54 0 .36.03.7.1 1.04-3.77-.2-7.12-2-9.36-4.75-.4.67-.6 1.45-.6 2.3 0 1.56.8 2.95 2 3.77-.74-.03-1.44-.23-2.05-.57v.06c0 2.2 1.56 4.03 3.64 4.44-.67.2-1.37.2-2.06.08.58 1.8 2.26 3.12 4.25 3.16C5.78 18.1 3.37 18.74 1 18.46c2 1.3 4.4 2.04 6.97 2.04 8.35 0 12.92-6.92 12.92-12.93 0-.2 0-.4-.02-.6.9-.63 1.96-1.22 2.56-2.14z"/></svg>
  109.                         </div>
  110.                       </div>
  111.                     </a>
  112.                     <!-- Sharingbutton E-Mail -->
  113.                     <a class="resp-sharing-button__link" href="mailto:?subject={{Entry.label}}&amp;body={{shareUrl}}" target="_self" title="E-Mail" aria-label="">
  114.                       <div class="resp-sharing-button resp-sharing-button--email resp-sharing-button--small">
  115.                         <div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid">
  116.                           <svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24"><path
  117.                             d="M22 4H2C.9 4 0 4.9 0 6v12c0 1.1.9 2 2 2h20c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM7.25 14.43l-3.5 2c-.08.05-.17.07-.25.07-.17 0-.34-.1-.43-.25-.14-.24-.06-.55.18-.68l3.5-2c.24-.14.55-.06.68.18.14.24.06.55-.18.68zm4.75.07c-.1 0-.2-.03-.27-.08l-8.5-5.5c-.23-.15-.3-.46-.15-.7.15-.22.46-.3.7-.14L12 13.4l8.23-5.32c.23-.15.54-.08.7.15.14.23.07.54-.16.7l-8.5 5.5c-.08.04-.17.07-.27.07zm8.93 1.75c-.1.16-.26.25-.43.25-.08 0-.17-.02-.25-.07l-3.5-2c-.24-.13-.32-.44-.18-.68s.44-.32.68-.18l3.5 2c.24.13.32.44.18.68z"/></svg>
  118.                         </div>
  119.                       </div>
  120.                     </a>
  121.                     <!-- Sharingbutton WhatsApp -->
  122.                     <a class="resp-sharing-button__link" href="whatsapp://send?text={{Entry.label}}%20{{shareUrl}}" target="_blank" title="WhatsApp" aria-label="">
  123.                       <div class="resp-sharing-button resp-sharing-button--whatsapp resp-sharing-button--small">
  124.                         <div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid">
  125.                           <svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24"><path
  126.                             d="M20.1 3.9C17.9 1.7 15 .5 12 .5 5.8.5.7 5.6.7 11.9c0 2 .5 3.9 1.5 5.6L.6 23.4l6-1.6c1.6.9 3.5 1.3 5.4 1.3 6.3 0 11.4-5.1 11.4-11.4-.1-2.8-1.2-5.7-3.3-7.8zM12 21.4c-1.7 0-3.3-.5-4.8-1.3l-.4-.2-3.5 1 1-3.4L4 17c-1-1.5-1.4-3.2-1.4-5.1 0-5.2 4.2-9.4 9.4-9.4 2.5 0 4.9 1 6.7 2.8 1.8 1.8 2.8 4.2 2.8 6.7-.1 5.2-4.3 9.4-9.5 9.4zm5.1-7.1c-.3-.1-1.7-.9-1.9-1-.3-.1-.5-.1-.7.1-.2.3-.8 1-.9 1.1-.2.2-.3.2-.6.1s-1.2-.5-2.3-1.4c-.9-.8-1.4-1.7-1.6-2-.2-.3 0-.5.1-.6s.3-.3.4-.5c.2-.1.3-.3.4-.5.1-.2 0-.4 0-.5C10 9 9.3 7.6 9 7c-.1-.4-.4-.3-.5-.3h-.6s-.4.1-.7.3c-.3.3-1 1-1 2.4s1 2.8 1.1 3c.1.2 2 3.1 4.9 4.3.7.3 1.2.5 1.6.6.7.2 1.3.2 1.8.1.6-.1 1.7-.7 1.9-1.3.2-.7.2-1.2.2-1.3-.1-.3-.3-.4-.6-.5z"/></svg>
  127.                         </div>
  128.                       </div>
  129.                     </a>
  130.                     <!-- Sharingbutton Telegram -->
  131.                     <a class="resp-sharing-button__link" href="https://telegram.me/share/url?text={{Entry.label}}&amp;url={{shareUrl}}" target="_blank" title="Telegram" aria-label="">
  132.                       <div class="resp-sharing-button resp-sharing-button--telegram resp-sharing-button--small">
  133.                         <div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid">
  134.                           <svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24"><path
  135.                             d="M.707 8.475C.275 8.64 0 9.508 0 9.508s.284.867.718 1.03l5.09 1.897 1.986 6.38a1.102 1.102 0 0 0 1.75.527l2.96-2.41a.405.405 0 0 1 .494-.013l5.34 3.87a1.1 1.1 0 0 0 1.046.135 1.1 1.1 0 0 0 .682-.803l3.91-18.795A1.102 1.102 0 0 0 22.5.075L.706 8.475z"/></svg>
  136.                         </div>
  137.                       </div>
  138.                     </a>
  139.                   </div>
  140.                 {% endif %} #}
  141.               </div>
  142.             </div>
  143.           {% endfor %}
  144.         </div>
  145.         <div class="swiper-pagination"></div>
  146.         <div class="swiper-button-prev"></div>
  147.         <div class="swiper-button-next"></div>
  148.       </div>
  149.     </div>
  150.     {% if config['show_all'] is defined and config['show_all'] is not empty %}
  151.       <div class="more-news text-center">
  152.         <a href="{{baseUrl}}" class="btn">{{'Alle berichten tonen'|trans}} <i class="fa fa-arrow-right"></i></a>
  153.       </div>
  154.     {% endif %}
  155.     {% if config['pagination'] is defined and config['pagination'] is not empty %}
  156.       {% include "CmsBundle::pagination_bootstrap.html.twig" with {
  157.         currentPage : page,
  158.         lastPage: pages,
  159.         showAlwaysFirstAndLast: true
  160.       }
  161.       only %}
  162.     {% endif %}
  163.   </div>
  164. {% endif %}