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

Open in your IDE?
  1. {% set spacingSelect %}
  2.     {{ pimcore_checkbox("checkSpacing", {
  3.         "reload": true
  4.     }) }}
  5. {% endset %}
  6. {% set noSpacingTop = '' %}
  7. {% set brickAnchorId = '' %}
  8. {% if pimcore_input("brickAnchorIdInput") is not empty %}
  9.     {% set brickAnchorId = pimcore_input("brickAnchorIdInput")|lowercase %}
  10. {% endif %}
  11. {% if pimcore_checkbox('checkSpacing').isChecked() %}
  12.     {% set noSpacingTop = 'no-offset-top' %}
  13. {% endif %}
  14. {% set UID = uniqid() %}
  15. {% set hasSliderSelect %}
  16.     {{ pimcore_select("hasSlider", {
  17.         "store": [
  18.         ["has-slider", "Slider"],
  19.         ["no-slider", "Listenansicht"]
  20.         ],
  21.         "width": 300,
  22.         "reload": true
  23.     }) }}
  24. {% endset %}
  25. {% set colSelect %}
  26.     {{ pimcore_select("cols", {
  27.         "store": [
  28.         ["xs-12 full", "1"],
  29.         ["xs-12 m-6 half", "2"],
  30.         ["xs-12 m-6 l-4 one-third", "3"]
  31.         ],
  32.         "width": 300,
  33.         "reload": true
  34.     }) }}
  35. {% endset %}
  36. {% set colsSelectResult = pimcore_select("cols").getData() %}
  37. {% if editmode %}
  38.     <div class="flex-col offset-bottom-single">
  39.         <div class="col xs-12 m-6 l-3">
  40.             <span class="hint">{{ 'admin.brick.hint.anchorId' |trans }}</span>
  41.             {{ pimcore_input("brickAnchorIdInput") }}
  42.         </div>
  43.         <div class="col xs-12 m-6 l-3">
  44.             <div class="select-items">
  45.                 <div class="hint">
  46.                     {{ 'admin.brick.hint.paddingTop' |trans }}
  47.                 </div>
  48.                 {{ spacingSelect }}
  49.             </div>
  50.         </div>
  51.         <div class="col xs-12 m-6 l-3">
  52.             <span class="hint">{{ 'admin.brick.hint.selectCol' |trans }}</span>
  53.             {{ colSelect }}
  54.         </div>
  55.         <div class="col xs-12 m-6 l-3">
  56.             <span class="hint">{{ 'admin.brick.hint.displayMode' |trans }}</span>
  57.             {{ hasSliderSelect }}
  58.         </div>
  59.     </div>
  60. {% endif %}
  61. {% set contentWidthSelectResult = pimcore_select("contentWidth") %}
  62. {% set BundleName =  document.module | replace ({'Bundle' : ''})%}
  63. {% set colsSelectResultClass %}
  64.     {% if colsSelectResult == 'xs-12 m-6 half' %}
  65.         half
  66.     {% elseif colsSelectResult == 'xs-12 full' %}
  67.         full
  68.     {% else %}
  69.         one-third
  70.     {% endif %}
  71. {% endset %}
  72. {% set sliderClass %}
  73.     {% if not editmode %}
  74.         {{ pimcore_select("hasSlider").getData() }}
  75.     {% endif %}
  76. {% endset %}
  77. {% if editmode %}
  78. <div class="admin teaser-panel-row">
  79. {% endif %}
  80.     <div id="{{ brickAnchorId }}" class="section {{ noSpacingTop }}">
  81.         <div class="panel has-background {{ sliderClass|spaceless }} {{ colsSelectResultClass|spaceless }}">
  82.             <div class="main-content">
  83.                 <div class="panel-container">
  84.                     <div class="panel-content">
  85.                         <div class="flex-col panel-slider">
  86.                             {% for i in pimcore_iterate_block(pimcore_block('contentblock')) %}
  87.                                 {% set productLink = pimcore_href("selectProduct").getElement() %}
  88.                                 <div class="col {{ colsSelectResult }}">
  89.                                     {% if editmode %}
  90.                                         <div class="offset-bottom-single">
  91.                                             <span class="hint">
  92.                                         {{ 'admin.brick.hint.addProduct'|trans }}</span>
  93.                                             {{ pimcore_href("selectProduct", {
  94.                                                 "types": ["object"],
  95.                                                 "subtypes": {
  96.                                                     "types": ["object"],
  97.                                                 },
  98.                                                 "classes": ["ProductFood", "ProductClothing", "Product"],
  99.                                                 "width": 300,
  100.                                                 "reload": true
  101.                                             }) }}
  102.                                         </div>
  103.                                     {% endif %}
  104.                                     {% if pimcore_href("selectProduct").isEmpty() != true %}
  105.                                         {% set detailViewUri    = pimcore_url(
  106.                                         {
  107.                                         "name": productLink.getName()|sanitized_url,
  108.                                         "articlenumber": productLink.getArticleNumber()
  109.                                         },
  110.                                          "shopHandlerProductDetail"
  111.                                         ) %}
  112.                                     {% endif %}
  113.                                     <div class="teaser image-text">
  114.                                         <div class="teaser-content">
  115.                                             <div class="teaser-image">
  116.                                                 {% if pimcore_href("selectProduct").isEmpty() != true %}
  117.                                                 <a href="{{ detailViewUri }}" aria-label="Open Details">
  118.                                                     {% else %}
  119.                                                     <a href="{{ pimcore_link("productLink").getHref() }}" target="{{ pimcore_link("productLink").getTarget() }}" aria-label="Open Details">
  120.                                                         {% endif %}
  121.                                                         <div class="image">
  122.                                                             {% if colsSelectResult == 'xs-12 full' %}
  123.                                                                 {{ pimcore_image("teaserImage", {
  124.                                                                     "title": "Drag your image here",
  125.                                                                     "thumbnail": "teaserImageFull" ~ bundleName
  126.                                                                 }) }}
  127.                                                             {% elseif colsSelectResult == 'xs-12 m-6 half' %}
  128.                                                                 {{ pimcore_image("teaserImage", {
  129.                                                                     "title": "Drag your image here",
  130.                                                                     "thumbnail": "teaserImageHalf" ~ bundleName
  131.                                                                 }) }}
  132.                                                             {% elseif colsSelectResult == 'xs-12 m-6 l-4 one-third' %}
  133.                                                                 {{ pimcore_image("teaserImage", {
  134.                                                                     "title": "Drag your image here",
  135.                                                                     "thumbnail": "teaserImage" ~ bundleName
  136.                                                                 }) }}
  137.                                                             {% endif %}
  138.                                                         </div>
  139.                                                         {% if pimcore_href("selectProduct").isEmpty() != true %}
  140.                                                     </a>
  141.                                                     {% else %}
  142.                                                 </a>
  143.                                                 {% endif %}
  144.                                             </div>
  145.                                             <div class="teaser-text-box">
  146.                                                 <div class="title-box">
  147.                                                     {% if pimcore_input("teaserHeadline") is not empty %}
  148.                                                         <h4>
  149.                                                             {{ pimcore_input("teaserHeadline", {'placeholder': 'Headline'})|trademark }}
  150.                                                         </h4>
  151.                                                     {% endif %}
  152.                                                 </div>
  153.                                                 <div class="content-box">
  154.                                                     {% if pimcore_input("teaserContent") is not empty %}
  155.                                                         <p>{{ pimcore_input("teaserContent", {'placeholder': 'Teaser Content'})|trademark }}</p>
  156.                                                     {% endif %}
  157.                                                 </div>
  158.                                                 <div class="teaser-link">
  159.                                                     {% if pimcore_href("selectProduct").isEmpty() != true %}
  160.                                                         <a class="button btn-default" href="{{ detailViewUri }}" aria-label="{{ 'Zum Produkt' |trans }}">{{ 'Zum Produkt' |trans }}</a>
  161.                                                     {% else %}
  162.                                                         {{ pimcore_link('productLink', {'class': "button btn-default"}) }}
  163.                                                     {% endif %}
  164.                                                 </div>
  165.                                             </div>
  166.                                         </div>
  167.                                     </div>
  168.                                 </div>
  169.                             {% endfor %}
  170.                         </div>
  171.                     </div>
  172.                 </div>
  173.             </div>
  174.         </div>
  175.     </div>
  176. {% if editmode %}
  177. </div>
  178. {% endif %}