templates/areas/teaser/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' } %}
  4.         {% include 'padding.html.twig' %}
  5.         <div class="my-3 flex flex-wrap overflow-hidden">
  6.             <div class="w-1/4 overflow-hidden">
  7.                 Darstellung:
  8.             </div>
  9.             <div class="w-3/4 overflow-hidden">
  10.                 {{ pimcore_select("darstellung", {
  11.                     "store": [
  12.                         ["teaser2col", "Teaserboxen, halbe Content-Breite (ohne Limit)"],
  13.                         ["teaser3col", "Teaserboxen, 3-spaltig (max)"],
  14.                         ["teaserRoundBorders", "Teaser mit abgerundeten Ecken und Icon"]
  15.                     ],
  16.                     "defaultValue" : "teaser2col",
  17.                     "reload" : true,
  18.                     "width" : 400
  19.                 }) }}
  20.             </div>
  21.         </div>
  22.         <hr/>
  23.         <div class="my-3 flex flex-wrap overflow-hidden">
  24.             <div class="w-1/2 overflow-hidden">
  25.                 {% include 'color-selector.html.twig' with { 'name': 'color', 'description': 'Hintergrundfarbe der Box' } %}
  26.             </div>
  27.             <div class="w-1/2 overflow-hidden">
  28.                 {% include 'icon-selector.html.twig' with { name: 'iconselect', description: 'Icon auswählen' } %}
  29.             </div>
  30.         </div>
  31.         <hr/>
  32.         <div class="my-3 flex flex-wrap overflow-hidden">
  33.             <div class="w-1/4 overflow-hidden">
  34.                 Content-Überschrift: (optional)
  35.             </div>
  36.             <div class="w-2/4 overflow-hidden">
  37.                 {{ pimcore_input("headline") }}
  38.             </div>
  39.         </div>
  40.         <div class="my-3 flex flex-wrap overflow-hidden">
  41.             <div class="w-1/4 overflow-hidden">
  42.                 SEO:
  43.             </div>
  44.             <div class="w-1/4 overflow-hidden">
  45.                 {% include 'seo.html.twig' with { 'name': 'seo', 'default' : 'h2' } %}
  46.             </div>
  47.             <div class="w-1/2 overflow-hidden">
  48.                 {% include 'color-selector.html.twig' with { 'name': 'seoHeadlineColor', 'description': 'Farbe der Überschrift', 'type': 'accordeon' } %}
  49.             </div>
  50.         </div>
  51.         <hr />
  52.         <div class="my-3 flex flex-wrap overflow-hidden">
  53.             <div class="w-1/4 overflow-hidden">
  54.                 Content-Teaser (optional):
  55.             </div>
  56.             <div class="w-3/4 overflow-hidden">
  57.                 {{ pimcore_wysiwyg("boxteaser") }}
  58.             </div>
  59.         </div>
  60.         <hr/>
  61.         {% set auswahl = pimcore_select("darstellung").getData() %}
  62.         {% if auswahl != 'teaserRoundBorders' %}
  63.             <div class="my-3 flex flex-wrap overflow-hidden">
  64.                 <div class="w-1/4 overflow-hidden">
  65.                     Soll die Content-Überschrift unterstrichen werden?
  66.                 </div>
  67.                 <div class="w-1/4 overflow-hidden">
  68.                     {{ pimcore_checkbox("hasDivider") }} JA
  69.                 </div>
  70.                 <div class="w-1/4 overflow-hidden">
  71.                     Überschrift zentrieren?
  72.                 </div>
  73.                 <div class="w-1/4 overflow-hidden">
  74.                     {{ pimcore_checkbox("head-center") }} JA
  75.                 </div>
  76.                 <div class="w-1/2 overflow-hidden">
  77.                     {% include 'color-selector.html.twig' with { 'name': 'headline-divider-color', 'description': 'Farbe vom Unterstrich', 'default': 'stwh-rot-2024' } %}
  78.                 </div>
  79.             </div>
  80.             <hr/>
  81.         {% endif %}
  82.         {# Teaser mit abgerundeten Ecken und Icon #}
  83.         {% if auswahl == 'teaserRoundBorders' %}
  84.             {% set block = pimcore_block('gridblock', {'manual' : true, 'limit' : 3, 'default' : 1}).start() %}
  85.             {% for b in block.iterator %}
  86.                 {% do block.blockConstruct() %}
  87.                 {% do block.blockStart() %}
  88.                 <div class="border border-gray-400 p-3">
  89.                     <p class="text-gray-400">Element: {{ (b+1) }}</p>
  90.                     {{ pimcore_link('teaser_link') }}
  91.                 </div>
  92.                 {% do block.blockEnd() %}
  93.                 {% do block.blockDestruct() %}
  94.             {% endfor %}
  95.             {% do block.end() %}
  96.         {% endif %}
  97.         {# Teaserboxen, halbe Content-Breite (ohne Limit) #}
  98.         {% if auswahl == 'teaser2col' %}
  99.             {% set block = pimcore_block('gridblock', {'manual' : true}).start() %}
  100.             {% for b in block.iterator %}
  101.                 {% do block.blockConstruct() %}
  102.                 {% do block.blockStart() %}
  103.                 <div class="border border-gray-400 p-3">
  104.                     <p class="text-gray-400">Element: {{ (b+1) }}</p>
  105.                     <div class="my-3 flex flex-wrap overflow-hidden">
  106.                         <div class="w-1/2 overflow-hidden pr-5">
  107.                             <div class="flex flex-wrap overflow-hidden">
  108.                                 <div class="w-4/6 overflow-hidden">
  109.                                     <p>Teaser-Headline: {{ pimcore_input("headline_box", { 'height': 100}) }}</p>
  110.                                 </div>
  111.                                 <div class="w-1/2 overflow-hidden">
  112.                                     {% include 'color-selector.html.twig' with { 'name': 'headline-box-divider-color', 'description': 'Farbe vom Unterstrich', 'default': 'stwh-rot-2024' } %}
  113.                                 </div>
  114.                             </div>
  115.                             <div class="my-3 flex flex-wrap overflow-hidden">
  116.                                 <div class="w-1/4 overflow-hidden">
  117.                                     SEO:
  118.                                 </div>
  119.                                 <div class="w-1/4 overflow-hidden">
  120.                                     {% include 'seo.html.twig' with { 'name': 'seo2', 'default' : 'h3' } %}
  121.                                 </div>
  122.                                 <div class="w-1/2 overflow-hidden">
  123.                                     {% include 'color-selector.html.twig' with { 'name': 'seoHeadlineColor2', 'description': 'Farbe der Überschrift', 'type': 'accordeon' } %}
  124.                                 </div>
  125.                             </div>
  126.                             <hr />
  127.                             <div class="flex flex-wrap overflow-hidden">
  128.                                 <div class="w-full overflow-hidden">
  129.                                     Teasertext:<br/>
  130.                                     {{ pimcore_textarea("teaser_box", { 'height': 100 }) }}
  131.                                 </div>
  132.                             </div>
  133.                             <hr/>
  134.                             <div class="flex flex-wrap overflow-hidden">
  135.                                 <div class="w-full overflow-hidden">
  136.                                     Teaserlink:<br/>
  137.                                     {{ pimcore_link("teaser_link") }}<br/>
  138.                                     <small>Hinweis: Link wird nur angezeigt, wenn ein Text und ein Pfad angegeben
  139.                                         wurden.</small>
  140.                                 </div>
  141.                             </div>
  142.                             <hr/>
  143.                         </div>
  144.                         <div class="w-1/2 overflow-hidden pl-5">
  145.                             Teaser-Bild:
  146.                             {{ pimcore_image("bild_box", {
  147.                                 "height": 200
  148.                             }) }}
  149.                         </div>
  150.                     </div>
  151.                 </div>
  152.                 {% do block.blockEnd() %}
  153.                 {% do block.blockDestruct() %}
  154.             {% endfor %}
  155.             {% do block.end() %}
  156.         {% endif %}
  157.         {# Teaserboxen, 3-spaltig (max) #}
  158.         {% if auswahl == 'teaser3col' %}
  159.             {% set block = pimcore_block('gridblock', {'manual' : true, 'limit' : 3, 'default' : 3}).start() %}
  160.             {% for b in block.iterator %}
  161.                 {% do block.blockConstruct() %}
  162.                 {% do block.blockStart() %}
  163.                 {% set azz = '' %}
  164.                 {% if pimcore_select("bullets").getData() != '' %}
  165.                     {% set azz = pimcore_select("bullets").getData() %}
  166.                     {% set azzColor = pimcore_select("bulletColor").getData() %}
  167.                     {% if azzColor is empty %}
  168.                         {% set azzColor = 'stwh-rot-2024' %}
  169.                     {% endif %}
  170.                 {% endif %}
  171.                 <div class="border border-gray-400 p-3">
  172.                     <p class="text-gray-400">Element: {{ (b+1) }}</p>
  173.                     <div class="my-3 flex flex-wrap overflow-hidden">
  174.                         <div class="w-1/2 overflow-hidden pr-3">
  175.                             Teaser-Bild:
  176.                             {{ pimcore_image("bild_box", {
  177.                                 "height": 200
  178.                             }) }}
  179.                         </div>
  180.                         <div class="w-1/2 overflow-hidden pl-3">
  181.                             <div class="flex flex-wrap overflow-hidden">
  182.                                 <div class="w-4/6 overflow-hidden">
  183.                                     <p>Teaser-Headline: {{ pimcore_input("headline_box", { 'height': 80}) }}</p>
  184.                                 </div>
  185.                             </div>
  186.                             <div class="my-3 flex flex-wrap overflow-hidden">
  187.                                 <div class="w-1/4 overflow-hidden">
  188.                                     SEO:
  189.                                 </div>
  190.                                 <div class="w-1/4 overflow-hidden">
  191.                                     {% include 'seo.html.twig' with { 'name': 'seo2', 'default' : 'h3' } %}
  192.                                 </div>
  193.                                 <div class="w-1/2 overflow-hidden">
  194.                                     {% include 'color-selector.html.twig' with { 'name': 'seoHeadlineColor2', 'description': 'Farbe der Überschrift', 'type': 'accordeon' } %}
  195.                                 </div>
  196.                             </div>
  197.                             <hr />
  198.                             <div class="w-full overflow-hidden {{ azz }} list-{{ azzColor }}">
  199.                                 Teasertext:
  200.                                 {{ pimcore_wysiwyg("teaser_box", { 'height': 100 }) }}
  201.                                 {% include 'bullet-points.html.twig' with { 'name': 'bullets', 'description': 'Aufzählungszeichen' } %}
  202.                                 {% include 'color-selector.html.twig' with { 'name': 'bulletColor', 'description': 'Farbe der Bullets', 'default': 'stwh-rot-2024' } %}
  203.                                 Teaserlink:
  204.                                 {{ pimcore_link("teaser_link") }}
  205.                             </div>
  206.                         </div>
  207.                     </div>
  208.                 </div>
  209.                 {% do block.blockEnd() %}
  210.                 {% do block.blockDestruct() %}
  211.             {% endfor %}
  212.             {% do block.end() %}
  213.         {% endif %}
  214.     </div>
  215.     {% include 'areaHeadAndFooter.html.twig' with { 'footer': true } %}
  216. {% else %}
  217.     <section
  218.         class="wysiwyg-heading {{ pimcore_select('paddingTop') }} {{ pimcore_select('paddingBottom') }} bg-{{ pimcore_select('color') }}">
  219.         <div class="container mx-auto px-5">
  220.             {% set auswahl = pimcore_select("darstellung").getData() %}
  221.             {# Teaser mit abgerundeten Ecken und Icon #}
  222.             {% if auswahl == 'teaserRoundBorders' %}
  223.             <div class="w-full flex flex-wrap">
  224.                 <div
  225.                     class="bg-white hidden lg:flex w-1/5 text-[200px] items-center border border-red-600 text-red-600 justify-center rounded-tl-large">
  226.                     {% include 'icon-selector.html.twig' with { name: 'iconselect', description: 'Icon auswählen' } %}
  227.                 </div>
  228.                 <div
  229.                     class="bg-red-600 flex flex-wrap w-full lg:w-4/5 p-5 items-center border border-red-600 text-white rounded-tl-3xl rounded-br-3xl lg:rounded-tl-none lg:rounded-br-large">
  230.                     {% if pimcore_input("headline") != '' %}
  231.                     {% set seo = pimcore_select("seo").getData() %}
  232.                     <{{ seo }} class="block font-bold text-center text-2xl md:text-3xl lg:text-4xl text-white
  233.                     mb-5">{{ pimcore_input("headline") }}</{{ seo }}>
  234.                 {% endif %}
  235.                 {{ pimcore_wysiwyg("boxteaser") }}
  236.                 {% if auswahl == 'teaserRoundBorders' %}
  237.                     {% set block = pimcore_block('gridblock', {'manual' : true, 'limit' : 3, 'default' : 1}).start() %}
  238.                     {% for b in block.iterator %}
  239.                         {% do block.blockConstruct() %}
  240.                         {% do block.blockStart() %}
  241.                         <div class="w-full md:w-1/3 teaser">
  242.                             {% include 'widgets/morelink.html.twig' with { name: 'teaser_link', othercolor: 'white' } %}
  243.                         </div>
  244.                         {% do block.blockEnd() %}
  245.                         {% do block.blockDestruct() %}
  246.                     {% endfor %}
  247.                     {% do block.end() %}
  248.                 {% endif %}
  249.             </div>
  250.         </div>
  251.         {% endif %}
  252.         {# Teaserboxen, halbe Content-Breite (ohne Limit) #}
  253.         {% if auswahl == 'teaser2col' %}
  254.             {% if pimcore_input("headline") != '' %}
  255.                 {% set bordy = '' %}
  256.                 {% set borderColor = pimcore_select('headline-divider-color').getData() %}
  257.                 {% if pimcore_checkbox('hasDivider').isChecked() %}
  258.                     {% set bordy = 'border-b-2 pb-2 border-' ~ borderColor %}
  259.                 {% endif %}
  260.                 {% set center = '' %}
  261.                 {% if pimcore_checkbox('head-center').isChecked() %}
  262.                     {% set center = 'lg:mx-auto' %}
  263.                 {% endif %}
  264.                 <div class="flex flex-wrap overflow-hidden">
  265.                     <div class="{{ center }} overflow-hidden">
  266.                         {% set seo = pimcore_select("seo").getData() %}
  267.                         <{{ seo }} class="text-{{ pimcore_select("seoHeadlineColor").getData() }} block font-bold mb-5 text-2xl md:text-4xl lg:text-5xl {{ bordy }}">
  268.                         {{ pimcore_input("headline") }}
  269.                     </{{ seo }}>
  270.                 </div>
  271.                 </div>
  272.                 {% if pimcore_wysiwyg("boxteaser") != '' %}
  273.                     <div class="flex flex-wrap overflow-hidden">
  274.                         <div class="{{ center }} mb-5">
  275.                             <div class="text-lg">
  276.                                 {{ pimcore_wysiwyg("boxteaser") }}
  277.                             </div>
  278.                         </div>
  279.                     </div>
  280.                 {% endif %}
  281.             {% endif %}
  282.             <div class="lg:grid lg:grid-cols-2 grid-cols-1 lg:gap-8">
  283.                 {% set block = pimcore_block('gridblock', {'manual' : true}).start() %}
  284.                 {% for b in block.iterator %}
  285.                     {% do block.blockConstruct() %}
  286.                     {% do block.blockStart() %}
  287.                     {% set seo2 = pimcore_select("seo2").getData() %}
  288.                     {% set borderColorBox = pimcore_select('headline-box-divider-color').getData() %}
  289.                      {% if borderColorBox is empty %}
  290.                        {% set borderColorBox = 'stwh-rot-2024' %}
  291.                     {% endif %}
  292.                     {% if pimcore_link("teaser_link").getHref() != '' %}
  293.                         <a target="{{ pimcore_link("teaser_link").getTarget() }}" href="{{ pimcore_link("teaser_link").getHref() }}">
  294.                     {% endif %}
  295.                     <div class="group relative overflow-hidden mt-1 mb-5 lg:mb-0 aspect-[16/9] rounded-lg">
  296.                         <div
  297.                             class="lazy absolute group-hover:scale-110 w-full h-full top-0 left-0 transition-all duration-300 ease-in-out bg-cover"
  298.                             data-bg="{{ pimcore_image("bild_box").getThumbnail('teaser-bild') }}"></div>
  299.                         <div class="relative h-full flex flex-wrap content-end">
  300.                             <div class="bg-gradient-to-t from-black p-4 md:p-10 text-base md:text-xl w-full content-end text-white">
  301.                                 <{{ seo2 }} class="block font-bold text-xl md:text-4xl
  302.                                 lg:text-5xl">{{ pimcore_input("headline_box") }}</{{ seo2 }}>
  303.                             <span class="flex w-1/4 md:pb-3 pb-1 md:mt-3 border-t-4 border-{{ borderColorBox }}"></span>
  304.                             {{ pimcore_textarea("teaser_box", {
  305.                                 "nl2br": true
  306.                             }) }}
  307.                             {% if pimcore_link("teaser_link").getHref() != '' and pimcore_link("teaser_link").getText() != '' %}
  308.                                 {% include 'widgets/morelink.html.twig' with {name: 'teaser_link', act: 'nolink', othercolor: 'white' } %}
  309.                             {% endif %}
  310.                             </div>
  311.                         </div>
  312.                     </div>
  313.                     {% if pimcore_link("teaser_link").getHref() != '' %}
  314.                         </a>
  315.                     {% endif %}
  316.                     {% do block.blockEnd() %}
  317.                     {% do block.blockDestruct() %}
  318.                 {% endfor %}
  319.                 {% do block.end() %}
  320.             </div>
  321.         {% endif %}
  322.         {# Teaserboxen, 3-spaltig (max) #}
  323.         {% if auswahl == 'teaser3col' %}
  324.             {% if pimcore_input("headline") != '' %}
  325.                 {% set bordy = '' %}
  326.                 {% set borderColor = pimcore_select('headline-divider-color').getData() %}
  327.                 {% if pimcore_checkbox('hasDivider').isChecked() %}
  328.                     {% set bordy = 'border-b-2 pb-2 border-' ~ borderColor %}
  329.                 {% endif %}
  330.                 {% set center = '' %}
  331.                 {% if pimcore_checkbox('head-center').isChecked() %}
  332.                     {% set center = 'lg:mx-auto' %}
  333.                 {% endif %}
  334.                 <div class="flex flex-wrap overflow-hidden">
  335.                     <div class="{{ center }} overflow-hidden">
  336.                         {% set seo = pimcore_select("seo").getData() %}
  337.                         <{{ seo }} class="text-{{ pimcore_select("seoHeadlineColor").getData() }} block mb-5 text-2xl md:text-4xl lg:text-5xl font-bold {{ bordy }}">
  338.                         {{ pimcore_input("headline") }}
  339.                     </{{ seo }}>
  340.                 </div>
  341.                 </div>
  342.                 {% if pimcore_wysiwyg("boxteaser") != '' %}
  343.                     <div class="flex flex-wrap overflow-hidden">
  344.                         <div class="{{ center }} mb-5">
  345.                             <div class="text-lg">
  346.                                 {{ pimcore_wysiwyg("boxteaser") }}
  347.                             </div>
  348.                         </div>
  349.                     </div>
  350.                 {% endif %}
  351.             {% endif %}
  352.             <div class="lg:grid lg:grid-cols-3 grid-cols-1 gap-6">
  353.             {% set block = pimcore_block('gridblock', {'manual' : true}).start() %}
  354.             {% for b in block.iterator %}
  355.                 {% do block.blockConstruct() %}
  356.                 {% do block.blockStart() %}
  357.                 {% set seo2 = pimcore_select("seo2").getData() %}
  358.                 {% set azz = '' %}
  359.                 {% if pimcore_select("bullets").getData() != '' %}
  360.                     {% set azz = pimcore_select("bullets").getData() %}
  361.                     {% set azzColor = pimcore_select("bulletColor").getData() %}
  362.                     {% if azzColor is empty %}
  363.                         {% set azzColor = 'stwh-rot-2024' %}
  364.                     {% endif %}
  365.                 {% endif %}
  366.             <div class="overflow-hidden flex flex-col mb-10 md:mb-0 {{ azz }} list-{{ azzColor }}">
  367.                 <img loading="lazy" class="object-cover rounded-lg pb-5"
  368.                      src="{{ pimcore_image("bild_box", {
  369.                          format: 'webp'
  370.                      }).getThumbnail('teaser-bild') }}"
  371.                      alt="{{ pimcore_image("bild_box").getAlt() }}" title="{{ pimcore_image("bild_box").getAlt() }}"/>
  372.                 <{{ seo2 }} class="text-{{ pimcore_select("seoHeadlineColor2").getData() }} block pb-5 font-bold text-xl md:text-2xl
  373.                 lg:text-3xl">{{ pimcore_input("headline_box") }}</{{ seo2 }}>
  374.                 <span class="text flex-grow">
  375.                                             {{ pimcore_wysiwyg("teaser_box") }}
  376.                                         </span>
  377.                 {% if pimcore_link("teaser_link") != '' %}
  378.                     {% set othercolor = '!text-' ~ pimcore_select("seoHeadlineColor2").getData() %}
  379.                     <span class="mehr">
  380.                         {% include 'widgets/morelink.html.twig' with {name: 'teaser_link', othercolor: othercolor } %}
  381.                     </span>
  382.                 {% endif %}
  383.                 </div>
  384.                 <hr class="border-t md:hidden mb-5"/>
  385.                 {% do block.blockEnd() %}
  386.                 {% do block.blockDestruct() %}
  387.             {% endfor %}
  388.             {% do block.end() %}
  389.             </div>
  390.         {% endif %}
  391.         </div>
  392.     </section>
  393. {% endif %}