templates/Includes/regionSlide.html.twig line 1

Open in your IDE?
  1. {# render footer-template #}
  2. {% set index = 0 %}
  3. {% set includeMainRegion = true %}
  4. {% if document.property('region') and not document.property('region').isMainRegion %}
  5.     {% set index = getIndexFromRegion(document.property('region'), includeMainRegion) %}
  6. {% endif %}
  7. {% set regions = getRegionsArray(includeMainRegion) %}
  8. {% set regionsData = [] %}
  9. {% for name, regionObject in regions %}
  10.     {% if regionObject.siteConfig.regionSlideMap.marker and regionObject.siteConfig.regionSlideMap.marker[0] %}
  11.         {% set regionsData = regionsData|merge([
  12.             {
  13.                 "title": regionObject.name,
  14.                 "href": regionObject.siteConfig.home,
  15.                 "linkText": "region-slide.Zur Region"|trans,
  16.                 "hotspotName": name,
  17.                 "hotspotPosition": {
  18.                     "top": regionObject.siteConfig.regionSlideMap.marker[0]['top'],
  19.                     "left": regionObject.siteConfig.regionSlideMap.marker[0]['left']
  20.                 }
  21.             }
  22.         ]) %}
  23.     {% endif %}
  24. {% endfor %}
  25. <div class="js-render-template js-render-template--not-initially" style="min-height: 1px;">
  26.     <template class="js-render-template__template">
  27.         <section class="region-slide-wrapper">
  28.             <div class="region-slide">
  29.                 {# This is no content-area. Only used above footer #}
  30.         
  31.                 <div class="region-slide__inner" style='--image-src: url("{{ siteConfig.regionSlideBg.thumbnail('region-slide-bg') }}"); --image-src-xs: url("{{ siteConfig.regionSlideBg.thumbnail('region-slide-bg--xs') }}");'>
  32.                     <div class="region-slide__inner-body">
  33.                         <div class="region-slide__title-wrapper">
  34.                             <h2 class="region-slide__title">{{ siteConfig.regionSlideHeadline }}</h2>
  35.                             <div class="region-slide__sub-title">
  36.                                 {{ siteConfig.regionSlideSubHeadline }}
  37.                             </div>
  38.                         </div>
  39.                 
  40.                         <div class="js-region-slider region-slider" data-region-slider-initial-slide="{{ index }}">
  41.                             <div class="swiper-container region-slider__container js-region-slider__slider">
  42.                                 <div class="swiper-wrapper">
  43.                                     {% for region in regionsData %}
  44.                                         <div class="swiper-slide region-slider__item"
  45.                                              data-region-link="{{ region.href }}"
  46.                                              data-region-link-text="{{ region.linkText }}"
  47.                                              data-region-id="{{ region.hotspotName }}">
  48.                                             <div class="region-slider__title">
  49.                                                 {{ region.title }}
  50.                                             </div>
  51.                                     
  52.                                             <div class="region-slider__title--active">
  53.                                                 {{ region.title }}
  54.                                             </div>
  55.                                 
  56.                                         </div>
  57.                                     {% endfor %}
  58.                                 </div>
  59.                             </div>
  60.                         </div>
  61.                 
  62.                         <div class="region-slide__content">
  63.                             <div class="region-hotspots js-region-hotspots">
  64.                                 {{ siteConfig.regionSlideMap.thumbnail('region-slide-map').html({
  65.                                     imgAttributes: {
  66.                                         class: 'js-lazy-img region-slide__map'
  67.                                     },
  68.                                     lowQualityPlaceholder: true,
  69.                                 }) | raw }}
  70.                         
  71.                                 {% for region in regionsData %}
  72.                                     <div class="region-hotspots__wrapper" style="top: {{ region.hotspotPosition.top }}%; left: {{ region.hotspotPosition.left }}%;">
  73.                                         <a role="button" href="{{ region.href }}" class="region-hotspots__hotspot  js-region-hotspots__hotspot"
  74.                                            aria-label="{{ region.title }}" title="{{ region.title }}"
  75.                                            data-hotspot-id="{{ region.hotspotName }}"
  76.                                            aria-controls="hotspot-{{ region.hotspotName }}"
  77.                                            aria-expanded="false">
  78.                                     <span class="hotspots__hotspot-inner">
  79.                                         <span class="hotspots__hotspot-icon" aria-hidden="true"></span>
  80.                                     </span>
  81.                                         </a>
  82.                                     </div>
  83.                                 {% endfor %}
  84.                             </div>
  85.                     
  86.                     
  87.                             {#  HREF and data-event-tracking-label is set with JS #}
  88.                             <a href="#" class="btn btn-outline-white mt-md-5 mt-2 region-slide__btn js-region-slider__link gtm-navigation-regionen" data-event-tracking-category="Navigation Regionen" data-event-tracking-action="Footer" data-event-tracking-label="">
  89.                                 {{ 'region-slide.Zur Region'|trans }}
  90.                             </a>
  91.                     
  92.                             {% if not document.property('region').isMainRegion %}
  93.                                 <a href="/" class="region-slide__link mt-4">
  94.                                     {{ 'region-slide.zurück zur Steiermark.com'|trans }}
  95.                                 </a>
  96.                             {% endif %}
  97.                         </div>
  98.                     </div>
  99.         
  100.                 </div>
  101.     
  102.             </div>
  103.         </section>
  104.     </template>
  105. </div>