templates/Snippets/weatherSlide.html.twig line 1

Open in your IDE?
  1. {% if editmode %}
  2.     {{ include('Layout/includes/css.html.twig') }}
  3.     {{ include('Layout/includes/encore.html.twig', {
  4.         'staticDebugMode': staticDebugMode,
  5.         'file': 'js/content'
  6.     }) }}
  7.     <div class="editmode-box editmode-box--info">
  8.         <div class="editmode-box__header">
  9.             Weather Station
  10.         </div>
  11.         {{ pimcore_relation('weatherStation', {'types': ['object'], 'subtypes': ['object'], 'classes': ['WeatherStation']}) }}
  12.     </div>
  13. {% endif %}
  14. <section class="slide slide--has-bg {{ styleModifier|default('') }}">
  15.     {% if pimcore_relation('weatherStation').element %}
  16.         {% set bgImage = getCurrentWeatherImage( pimcore_relation('weatherStation').element , siteConfig) %}
  17.         {% if bgImage|default('') %}
  18.             <div class="slide__bg js-lazy-img js-lazy-img--bg" data-lazy-img-background="{{ bgImage.thumbnail('region-slide-bg').path|raw }}"></div>
  19.         {% endif %}
  20.     {% endif %}
  21.     <div class="container">
  22.         {{ include('Includes/title-block-editable.html.twig', {
  23.             isCentered: true,
  24.             isWhite: true,
  25.             styleModifier: 'title-block--shadow'
  26.         }) }}
  27.         {% if not pimcore_relation('weatherStation').empty %}
  28.             {% set today = pimcore_relation('weatherStation').element.today %}
  29.             <div class="row scrolling-row">
  30.                 {% if today %}
  31.                     <div class="col-md-7 col-11">
  32.                         <div class="weather-box bg-secondary">
  33.                             <div class="row">
  34.                                 <div class="col-4">
  35.                                     {{ include('Includes/Partials/weather-item.html.twig', {
  36.                                         title: 'weather-slide.Morgends'|trans,
  37.                                         date: today.date.format('d.m.Y'),
  38.                                         icon: today.symb06,
  39.                                         min: today.temp06
  40.                                     }) }}
  41.                                 </div>
  42.                                 <div class="col-4">
  43.                                     {{ include('Includes/Partials/weather-item.html.twig', {
  44.                                         title: 'weather-slide.Mittags'|trans,
  45.                                         date: today.date.format('d.m.Y'),
  46.                                         icon: today.symb12,
  47.                                         min: today.temp12
  48.                                     }) }}
  49.                                 </div>
  50.                                 <div class="col-4">
  51.                                     {{ include('Includes/Partials/weather-item.html.twig', {
  52.                                         title: 'weather-slide.Abends'|trans,
  53.                                         date: today.date.format('d.m.Y'),
  54.                                         icon: today.symb18,
  55.                                         min: today.temp18
  56.                                     }) }}
  57.                                 </div>
  58.                             </div>
  59.                         </div>
  60.                     </div>
  61.                 {% endif %}
  62.                 {% set tomorrow = pimcore_relation('weatherStation').element.tomorrow %}
  63.                 {% set overmorrow = pimcore_relation('weatherStation').element.overmorrow %}
  64.                 {% if tomorrow or overmorrow %}
  65.                     <div class="col-md-5 col-10">
  66.                         <div class="weather-box bg-secondary">
  67.                             <div class="row">
  68.                                 {% if tomorrow %}
  69.                                     <div class="col-6">
  70.                                         {{ include('Includes/Partials/weather-item.html.twig', {
  71.                                             title: 'weather-slide.Morgen'|trans,
  72.                                             date: tomorrow.date.format('d.m.Y'),
  73.                                             icon: tomorrow.symbDay,
  74.                                             min: tomorrow.tminDay,
  75.                                             max: tomorrow.tmaxDay
  76.                                         }) }}
  77.                                     </div>
  78.                                 {% endif %}
  79.                                 {% if overmorrow %}
  80.                                     <div class="col-6">
  81.                                         {{ include('Includes/Partials/weather-item.html.twig', {
  82.                                             title: 'weather-slide.Übermorgen'|trans,
  83.                                             date: overmorrow.date.format('d.m.Y'),
  84.                                             icon: overmorrow.symbDay,
  85.                                             min: overmorrow.tminDay,
  86.                                             max: overmorrow.tmaxDay
  87.                                         }) }}
  88.                                     </div>
  89.                                 {% endif %}
  90.                             </div>
  91.                         </div>
  92.                     </div>
  93.                 {% endif %}
  94.             </div>
  95.         {% endif %}
  96.     </div>
  97. </section>