templates/areas/teaserslider/view.html.twig line 1

Open in your IDE?
  1. {% if editmode %}
  2.     <div class="bg-gray-100 p-5 wysiwyg-heading">
  3.         {% include 'areaHeadAndFooter.html.twig' with { 'header': 'STWH: Teaser-Slider' } %}
  4.         {% include 'padding.html.twig' %}
  5.         <div class="my-3 flex flex-wrap overflow-hidden">
  6.             <div class="w-1/2 overflow-hidden pr-3">
  7.                 {% include 'color-selector.html.twig' with { 'name': 'color', 'description': 'Hintergrundfarbe der Box' } %}
  8.             </div>
  9.             <div class="w-1/4 overflow-hidden pl-3">
  10.                 Darstellung:
  11.             </div>
  12.             <div class="w-1/4 overflow-hidden">
  13.                 {{ pimcore_select("darstellung", {
  14.                     "store": [
  15.                         ["one", "Ein Teaser über volle Breite"],
  16.                         ["two", "Zwei Teaser nebeneinander"]
  17.                     ],
  18.                     "defaultValue" : "two"
  19.                 }) }}
  20.             </div>
  21.         </div>
  22.         {% set block = pimcore_block('gridblock', {'manual' : true, 'default' : 2}).start() %}
  23.         {% for b in block.iterator %}
  24.             {% do block.blockConstruct() %}
  25.             {% do block.blockStart() %}
  26.             {% set azz = '' %}
  27.             {% if pimcore_select("bullets").getData() != '' %}
  28.                 {% set azz = pimcore_select("bullets").getData() %}
  29.                 {% set azzColor = pimcore_select("bulletColor").getData() %}
  30.                 {% if azzColor is empty %}
  31.                     {% set azzColor = 'stwh-rot-2024' %}
  32.                 {% endif %}
  33.             {% endif %}
  34.             <div class="border border-gray-400 p-3">
  35.                 <p class="text-gray-400">Element: {{ (b+1) }}</p>
  36.                 <div class="my-3 flex flex-wrap overflow-hidden">
  37.                     <div class="w-1/2 overflow-hidden pr-3">
  38.                         <div class="my-3 flex flex-wrap overflow-hidden">
  39.                             <div class="w-full overflow-hidden">
  40.                                 <p>Teaser-Überschrift: {{ pimcore_textarea("headline_box", { 'height': 60}) }}</p>
  41.                             </div>
  42.                         </div>
  43.                         <div class="my-3 flex flex-wrap overflow-hidden">
  44.                             <div class="w-1/4 overflow-hidden">
  45.                                 SEO:
  46.                             </div>
  47.                             <div class="w-1/4 overflow-hidden">
  48.                                 {% include 'seo.html.twig' with { 'name': 'seo2', 'default' : 'h3' } %}
  49.                             </div>
  50.                             <div class="w-2/4 overflow-hidden">
  51.                                 {% include 'color-selector.html.twig' with { 'name': 'seoHeadlineColor', 'description': 'Farbe der Überschrift', 'type': 'accordeon' } %}
  52.                             </div>
  53.                         </div>
  54.                         <hr />
  55.                         <div class="my-3 flex flex-wrap overflow-hidden">
  56.                             <div class="w-full overflow-hidden {{ azz }} list-{{ azzColor }}">
  57.                                 Teasertext:
  58.                                 {{ pimcore_wysiwyg("teaser_box", { 'height': 100 }) }}
  59.                                 {% include 'bullet-points.html.twig' with { 'name': 'bullets', 'description': 'Aufzählungszeichen' } %}
  60.                                 {% include 'color-selector.html.twig' with { 'name': 'bulletColor', 'description': 'Farbe der Bullets', 'default': 'stwh-rot-2024' } %}
  61.                             </div>
  62.                         </div>
  63.                         <hr/>
  64.                         <div class="my-3 flex flex-wrap overflow-hidden">
  65.                             <div class="w-1/2 overflow-hidden">
  66.                                 Teaserlink:
  67.                             </div>
  68.                             <div class="w-1/2 overflow-hidden">
  69.                                 {{ pimcore_link("teaser_link") }}
  70.                             </div>
  71.                         </div>
  72.                         <hr/>
  73.                         <div class="my-3 flex flex-wrap overflow-hidden">
  74.                             <div class="w-3/4 overflow-hidden">
  75.                                 Soll die Überschrift unterstrichen werden?
  76.                             </div>
  77.                             <div class="w-1/4 overflow-hidden">
  78.                                 {{ pimcore_checkbox("hasDivider") }} JA
  79.                             </div>
  80.                             <div class="w-1/2 overflow-hidden">
  81.                                 {% include 'color-selector.html.twig' with { 'name': 'headline-divider-color', 'description': 'Farbe vom Unterstrich', 'default': 'stwh-rot-2024' } %}
  82.                             </div>
  83.                         </div>
  84.                     </div>
  85.                     <div class="w-1/2 overflow-hidden pl-3">
  86.                         Teaser-Bild:
  87.                         {{ pimcore_image("bild_box", {
  88.                             "height": 400
  89.                         }) }}
  90.                     </div>
  91.                 </div>
  92.             </div>
  93.             {% do block.blockEnd() %}
  94.             {% do block.blockDestruct() %}
  95.         {% endfor %}
  96.         {% do block.end() %}
  97.     </div>
  98.     {% include 'areaHeadAndFooter.html.twig' with { 'footer': true } %}
  99. {% else %}
  100.     {% set darstellung = pimcore_select("darstellung").getData() %}
  101.     <section
  102.         class="wysiwyg-heading {{ pimcore_select('paddingTop') }} {{ pimcore_select('paddingBottom') }} relative bg-{{ pimcore_select('color') }}">
  103.         <div class="container mx-auto px-5 overflow-hidden">
  104.             {# Ein Teaser-Slider über volle Breite #}
  105.             {% if darstellung == 'one' %}
  106.             <div class="teaserslider-full">
  107.                 <div class="swiper-wrapper">
  108.                     {% set block = pimcore_block('gridblock', {'manual' : true}).start() %}
  109.                     {% for b in block.iterator %}
  110.                     {% do block.blockConstruct() %}
  111.                     {% do block.blockStart() %}
  112.                     {% set seo2 = pimcore_select("seo2").getData() %}
  113.                     {% set azz = '' %}
  114.                     {% if pimcore_select("bullets").getData() != '' %}
  115.                         {% set azz = pimcore_select("bullets").getData() %}
  116.                         {% set azzColor = pimcore_select("bulletColor").getData() %}
  117.                         {% if azzColor is empty %}
  118.                             {% set azzColor = 'stwh-rot-2024' %}
  119.                         {% endif %}
  120.                     {% endif %}
  121.                     <div class="flex flex-wrap overflow-hidden swiper-slide {{ azz }} list-{{ azzColor }}">
  122.                         <div class="w-full lg:w-1/2 lg:pr-5">
  123.                             <img data-src="{{ pimcore_image("bild_box", {
  124.                                 format: 'webp'
  125.                             }).getThumbnail('teaser-bild') }}"
  126.                                  alt="{{ pimcore_image("bild_box").getAlt() }}"
  127.                                  title="{{ pimcore_image("bild_box").getAlt() }}"
  128.                                  class="swiper-lazy rounded-lg"/>
  129.                         </div>
  130.                         <div class="w-full lg:w-1/2 lg:pl-5 text-lg">
  131.                             {% set bordy = '' %}
  132.                             {% set borderColor = pimcore_select('headline-divider-color').getData() %}
  133.                             {% if pimcore_checkbox('hasDivider').isChecked() %}
  134.                                 {% set bordy = 'border-b-2 pb-2 border-' ~ borderColor %}
  135.                             {% endif %}
  136.                             <{{ seo2 }} class="text-{{ pimcore_select("seoHeadlineColor").getData() }} block py-5 font-bold lg:text-4xl md:text-3xl sm:text-xl {{ bordy }}
  137.                             ">{{ pimcore_textarea("headline_box")|nl2br }}</{{ seo2 }}>
  138.                         {{ pimcore_wysiwyg("teaser_box") }}
  139.                         {% if pimcore_link("teaser_link") != '' %}
  140.                             {% include 'widgets/morelink.html.twig' with {name: 'teaser_link' } %}
  141.                         {% endif %}
  142.                     </div>
  143.                 </div>
  144.                 {% do block.blockEnd() %}
  145.                 {% do block.blockDestruct() %}
  146.                 {% endfor %}
  147.                 {% do block.end() %}
  148.             </div>
  149.             <!-- If we need pagination -->
  150.             <div class="swiper-pagination"></div>
  151.             <!-- If we need navigation buttons -->
  152.             <div class="invisible lg:visible swiper-button-prev"></div>
  153.             <div class="invisible lg:visible swiper-button-next"></div>
  154.         </div>
  155.         {% endif %}
  156.         {# Zwei Teaser-Slider nebeneinander #}
  157.         {% if darstellung == 'two' %}
  158.             <div class="teaserslider">
  159.                 <div class="swiper-wrapper">
  160.                     {% set block = pimcore_block('gridblock', {'manual' : true}).start() %}
  161.                     {% for b in block.iterator %}
  162.                     {% do block.blockConstruct() %}
  163.                     {% do block.blockStart() %}
  164.                     {% set seo2 = pimcore_select("seo2").getData() %}
  165.                     {% set azz = '' %}
  166.                     {% if pimcore_select("bullets").getData() != '' %}
  167.                         {% set azz = pimcore_select("bullets").getData() %}
  168.                         {% set azzColor = pimcore_select("bulletColor").getData() %}
  169.                         {% if azzColor is empty %}
  170.                             {% set azzColor = 'stwh-rot-2024' %}
  171.                         {% endif %}
  172.                     {% endif %}
  173.                     <div class="swiper-slide {{ azz }} list-{{ azzColor }} text-lg">
  174.                         <div class="aspect-[3/2]">
  175.                             <img class="object-cover swiper-lazy rounded-lg"
  176.                                  data-src="{{ pimcore_image("bild_box", {
  177.                                      format: 'webp'
  178.                                  }).getThumbnail('teaser-bild') }}"
  179.                                  alt="{{ pimcore_image("bild_box").getAlt() }}"
  180.                                  title="{{ pimcore_image("bild_box").getAlt() }}"
  181.                             />
  182.                         </div>
  183.                         <{{ seo2 }} class="text-{{ pimcore_select("seoHeadlineColor").getData() }} block py-5 font-bold lg:text-5xl md:text-4xl
  184.                         sm:text-2xl">{{ pimcore_textarea("headline_box")|nl2br }}</{{ seo2 }}>
  185.                     {{ pimcore_wysiwyg("teaser_box") }}
  186.                     {% if pimcore_link("teaser_link") != '' %}
  187.                         {% include 'widgets/morelink.html.twig' with {name: 'teaser_link' } %}
  188.                     {% endif %}
  189.                 </div>
  190.                 {% do block.blockEnd() %}
  191.                 {% do block.blockDestruct() %}
  192.                 {% endfor %}
  193.                 {% do block.end() %}
  194.             </div>
  195.             <!-- If we need pagination -->
  196.             <div class="swiper-pagination"></div>
  197.             <!-- If we need navigation buttons -->
  198.             <div class="invisible lg:visible swiper-button-prev"></div>
  199.             <div class="invisible lg:visible swiper-button-next"></div>
  200.             </div>
  201.         {% endif %}
  202.         </div>
  203.     </section>
  204. {% endif %}