templates/includes/teaser/location-teaser.html.twig line 1

Open in your IDE?
  1. {% set detailLink = linkGenerator(location) %}
  2. <article class="location-teaser shadow border-radius-4 stretch-link">
  3.     {% if location.image %}
  4.         <div class="ratio ratio-6x4">
  5.             {{ location.image.thumbnail('location-teaser').getHtml({
  6.                 imgAttributes: {
  7.                     class: 'js-lazy-img ratio-item location-teaser__img',
  8.                 },
  9.                 lowQualityPlaceholder: true,
  10.             })|raw }}
  11.         </div>
  12.     {% endif %}
  13.     <div class="location-teaser__content d-flex flex-column">
  14.         {{ include('includes/resort-badge.html.twig', {
  15.             resorts: location.resorts
  16.         }) }}
  17.         <h3 class="location-teaser__title">
  18.             <a href="{{ detailLink }}" class="stretch-link__link">
  19.                 {{ location.name }}
  20.             </a>
  21.         </h3>
  22.         <div class="location-teaser__text-wrapper d-flex">
  23.             {% if location.street or location.zip or location.city %}
  24.                 <address class="location-teaser__address mb-0">
  25.                     {% if location.street %}
  26.                         {{ location.street }} <br>
  27.                     {% endif %}
  28.                     {% if location.zip or location.city %}
  29.                         {{ location.zip }} {{ location.city }} <br>
  30.                     {% endif %}
  31.                     {% if location.config()[0] is defined and location.config()[0].country %}
  32.                         {{ elements_get_country_name(location.config()[0].country) }}
  33.                     {% endif %}
  34.                 </address>
  35.             {% endif %}
  36.             {% if location.phone or location.email %}
  37.                 <div class="location-teaser__contact">
  38.                     {% if location.phone %}
  39.                         <div>
  40.                             <a href="tel:{{ location.phone|phone }}" class="link-with-icon text-secondary" title="phone">
  41.                                 <span class="icon icon-phone" aria-hidden="true"></span>{{ location.phone }}
  42.                             </a>
  43.                         </div>
  44.                     {% endif %}
  45.                     {% if location.email %}
  46.                         <div>
  47.                             <a href="mailto:{{ location.email }}" class="link-with-icon text-secondary" title="phone">
  48.                                 <span class="icon icon-mail" aria-hidden="true"></span>{{ location.email }}
  49.                             </a>
  50.                         </div>
  51.                     {% endif %}
  52.                 </div>  
  53.             {% endif %}
  54.         </div>
  55.         <a href="{{ detailLink }}" class="btn btn-dark">{{ 'teaser.read more'|trans }}</a>
  56.     </div>
  57. </article>