src/Develey/MautnerSpezialitaetenBundle/Resources/views/Areas/TeaserPanel/view.html.twig line 1

Open in your IDE?
  1. {% set hasSliderSelect %}
  2.     {{ pimcore_select("hasSlider", {
  3.         "store": [
  4.         ["has-slider", "Slider"],
  5.         ["no-slider", "Listenansicht"]
  6.         ],
  7.         "width": 300,
  8.         "reload": true
  9.     }) }}
  10. {% endset %}
  11. {% set colSelect %}
  12.     {{ pimcore_select("cols", {
  13.         "store": [
  14.         ["xs-12 full", "1"],
  15.         ["xs-12 m-6 half", "2"],
  16.         ["xs-12 m-6 l-4 one-third", "3"],
  17.         ["xs-12 m-6 l-3 one-fourth", "4"],
  18.         ],
  19.         "width": 300,
  20.         "reload": true
  21.     }) }}
  22. {% endset %}
  23. {% set colsSelectResult = pimcore_select("cols").getData() %}
  24. {% if editmode %}
  25.     <div class="flex-col">
  26.         <div class="xs-12 flex-col">
  27.             <div class="col xs-12 m-6 l-3">
  28.                 <div class="select-items">
  29.                     <div class="hint">
  30.                         {{ 'Teaser Content Breite:' |trans }}
  31.                     </div>
  32.                     {{ colSelect }}
  33.                 </div>
  34.             </div>
  35.             <div class="col xs-12 m-6 l-3">
  36.                 <div class="select-items">
  37.                     <div class="hint">
  38.                         {{ ' Darstellungsart:' |trans }}
  39.                     </div>
  40.                     {{ hasSliderSelect }}
  41.                 </div>
  42.             </div>
  43.             <div class="col xs-12 m-6 l-3">
  44.                 {% if pimcore_select("contentWidth").isEmpty() %}
  45.                     {% do pimcore_select("contentWidth").setDataFromResource("main-content") %}
  46.                 {% endif %}
  47.                 <span class="hint">{{ 'Contentbreite wählen' |trans }}</span>
  48.                 {{ pimcore_select("contentWidth", {
  49.                     "store": [
  50.                     ["fullwidth", "Fullwidth"],
  51.                     ["main-content", "Contentbreite"]
  52.                     ],
  53.                     "reload": true
  54.                 }) }}
  55.             </div>
  56.             <div class="col xs-12 m-6 l-3">
  57.                 {% if pimcore_select("headlineType").isEmpty() %}
  58.                     {% do pimcore_select("headlineType").setDataFromResource("h2") %}
  59.                 {% endif %}
  60.                 <span class="hint">{{ 'Headline Typ wählen' |trans }}</span>
  61.                 {{ pimcore_select("headlineType", {
  62.                     "store": [
  63.                     ["h2", "Überschrift h2"],
  64.                     ["h3", "Überschrift h3"],
  65.                     ["h4", "Überschrift h4"]
  66.                     ],
  67.                     "width": 300,
  68.                     "reload": true
  69.                 }) }}
  70.             </div>
  71.         </div>
  72.     </div>
  73. {% endif %}
  74.  {% set contentWidthSelectResult = pimcore_select("contentWidth") %}
  75. {% if editmode %}
  76. <div class="admin teaser-panel-row">
  77.     {% else %}
  78.     {% endif %}
  79.     <div class="section">
  80.         <div class="panel has-background {% if contentWidthSelectResult == 'fullwidth' %}pattern {% endif %} {% if editmode %} {% else %}{{ pimcore_select("hasSlider").getData() }} {% endif %}{% if colsSelectResult == 'xs-12 m-6 half' %}half{% elseif colsSelectResult == 'xs-12 full' %}full{% elseif colsSelectResult == 'xs-12 m-6 l-3 one-fourth' %}one-fourth{% else %}one-third{% endif %}">
  81.             {% if contentWidthSelectResult != 'fullwidth' %}
  82.             <div class="main-content">
  83.                 {% endif %}
  84.                 <div class="panel-container">
  85.                     <div class="panel-content">
  86.                         <div class="flex-col">
  87.                             <div class="col xs-12">
  88.                                 <div class="headline">
  89.                                     <{{ pimcore_select("headlineType").getData() }}
  90.                                     >{{ pimcore_input("teaserTextBackgroundHeadline", {
  91.                                         "placeholder": 'Headline'
  92.                                     }) }}</{{ pimcore_select("headlineType").getData() }}>
  93.                             </div>
  94.                         </div>
  95.                     </div>
  96.                     <div class="flex-col panel-slider">
  97.                         {% for i in pimcore_iterate_block(pimcore_block('contentblock')) %}
  98.                             {% set productLink = pimcore_href("selectProduct").getElement() %}
  99.                             <div class="col {{ colsSelectResult }}">
  100.                                 {% if editmode %}
  101.                                     <span class="hint">
  102.                                         {{ 'Verlinkung zu bestehendem Produkt?'|trans }}</span>
  103.                                     {{ pimcore_href("selectProduct", {
  104.                                         "types": ["object"],
  105.                                         "subtypes": {
  106.                                             "types": ["object"],
  107.                                         },
  108.                                         "classes": ["ProductFood", "ProductClothing", "Product"],
  109.                                         "width": 300,
  110.                                         "reload": true
  111.                                     }) }}
  112.                                 {% endif %}
  113.                                 {% if pimcore_href("selectProduct").isEmpty() != true %}
  114.                                     {% set detailViewUri    = pimcore_url(
  115.                                     {
  116.                                     "name": productLink.getName()|sanitized_url,
  117.                                     "articlenumber": productLink.getArticleNumber()
  118.                                     },
  119.                                     "shopHandlerProductDetail" ~ bundleName
  120.                                     ) %}
  121.                                 {% endif %}
  122.                                 <div class="teaser image-text">
  123.                                     <div class="teaser-content">
  124.                                         {% if pimcore_href("selectProduct").isEmpty() != true %}
  125.                                         <a href="{{ detailViewUri }}">
  126.                                             <div class="image">
  127.                                                 {% if colsSelectResult == 'xs-12 full' %}
  128.                                                     {{ productLink.getProductImage().getThumbnail("teaserImageFull").getHTML() |raw }}
  129.                                                 {% elseif colsSelectResult == 'xs-12 m-6 half' and contentWidthSelectResult != 'fullwidth' %}
  130.                                                     {{ productLink.getProductImage().getThumbnail("teaserImageHalf").getHTML() |raw }}
  131.                                                 {% elseif colsSelectResult == 'xs-12 m-6 half' and contentWidthSelectResult == 'fullwidth' %}
  132.                                                     {{ productLink.getProductImage().getThumbnail("teaserImageHalfFullWidth").getHTML() |raw }}
  133.                                                 {% elseif colsSelectResult == 'xs-12 m-6 l-4 one-third' and contentWidthSelectResult != 'fullwidth' %}
  134.                                                     {{ productLink.getProductImage().getThumbnail("teaserImage").getHTML() |raw }}
  135.                                                 {% elseif colsSelectResult == 'xs-12 m-6 l-4 one-third' and contentWidthSelectResult == 'fullwidth' %}
  136.                                                     {{ productLink.getProductImage().getThumbnail("teaserImageFullWidth").getHTML() |raw }}
  137.                                                 {% elseif colsSelectResult == 'xs-12 m-6 l-3 one-fourth' and contentWidthSelectResult == 'fullwidth' %}
  138.                                                     {{ productLink.getProductImage().getThumbnail("teaserImageFullWidth").getHTML() |raw }}
  139.                                                 {% else %}
  140.                                                     {{ productLink.getProductImage().getThumbnail("teaserImage").getHTML() |raw }}
  141.                                                 {% endif %}
  142.                                             </div>
  143.                                             {% else %}
  144.                                             <a href="{{ pimcore_link("productLink").getHref() }}">
  145.                                                 <div class="image">
  146.                                                     {% if colsSelectResult == 'xs-12 full' %}
  147.                                                         {{ pimcore_image("teaserImage", {
  148.                                                             "title": "Drag your image here",
  149.                                                             "thumbnail": "teaserImageFull"
  150.                                                         }) }}
  151.                                                     {% elseif colsSelectResult == 'xs-12 m-6 half' and contentWidthSelectResult != 'fullwidth' %}
  152.                                                         {{ pimcore_image("teaserImage", {
  153.                                                             "title": "Drag your image here",
  154.                                                             "thumbnail": "teaserImageHalf"
  155.                                                         }) }}
  156.                                                     {% elseif colsSelectResult == 'xs-12 m-6 half' and contentWidthSelectResult == 'fullwidth' %}
  157.                                                         {{ pimcore_image("teaserImage", {
  158.                                                             "title": "Drag your image here",
  159.                                                             "thumbnail": "teaserImageHalfFullWidth"
  160.                                                         }) }}
  161.                                                     {% elseif colsSelectResult == 'xs-12 m-6 l-4 one-third' and contentWidthSelectResult != 'fullwidth' %}
  162.                                                         {{ pimcore_image("teaserImage", {
  163.                                                             "title": "Drag your image here",
  164.                                                             "thumbnail": "teaserImage"
  165.                                                         }) }}
  166.                                                     {% elseif colsSelectResult == 'xs-12 m-6 l-4 one-third' and contentWidthSelectResult == 'fullwidth' %}
  167.                                                         {{ pimcore_image("teaserImage", {
  168.                                                             "title": "Drag your image here",
  169.                                                             "thumbnail": "teaserImageFullWidth"
  170.                                                         }) }}
  171.                                                     {% endif %}
  172.                                                 </div>
  173.                                                 {% endif %}
  174.                                             </a>
  175.                                             <div class="teaser-text-box">
  176.                                                 <div class="title-box">
  177.                                                     {% if pimcore_input("teaserHeadline") is not empty %}
  178.                                                         <h4>
  179.                                                             {{ pimcore_input("teaserHeadline", {'placeholder': 'Headline'})|trademark }}
  180.                                                         </h4>
  181.                                                     {% endif %}
  182.                                                 </div>
  183.                                                 <div class="content-box">
  184.                                                     {% if pimcore_input("teaserContent") is not empty %}
  185.                                                         <p>{{ pimcore_input("teaserContent", {'placeholder': 'Teaser Content'})|trademark }}</p>
  186.                                                     {% endif %}
  187.                                                 </div>
  188.                                                 <div class="teaser-link">
  189.                                                     {% if pimcore_href("selectProduct").isEmpty() != true %}
  190.                                                         <a class="button btn-default" href="{{ detailViewUri }}" aria-label="{{ 'Zum Produkt' |trans }}">{{ 'Zum Produkt' |trans }}</a>
  191.                                                     {% else %}
  192.                                                         {{ pimcore_link('productLink', {'class': "button btn-default"}) }}
  193.                                                     {% endif %}
  194.                                                 </div>
  195.                                             </div>
  196.                                     </div>
  197.                                 </div>
  198.                             </div>
  199.                         {% endfor %}
  200.                     </div>
  201.                 </div>
  202.             </div>
  203.             {% if pimcore_select("contentWidth") != 'fullwidth' %}
  204.         </div>
  205.         {% endif %}
  206.     </div>
  207. </div>
  208. {% if editmode %}
  209.     </div>
  210. {% endif %}