src/CoreBundle/Resources/views/Areas/TeaserProductStory/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_checkbox('checkSpacing').isChecked() %}
  9.     {% set noSpacingTop = 'no-offset-top' %}
  10. {% endif %}
  11. {% set UID = uniqid() %}
  12. {% if pimcore_input("brickAnchorIdInput") is not empty %}
  13.     {% set brickAnchorId = pimcore_input("brickAnchorIdInput")|lowercase %}
  14. {% endif %}
  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-6 xl-4 one-third", "3"]
  31.         ],
  32.         "width": 300,
  33.         "reload": true
  34.     }) }}
  35. {% endset %}
  36. {% set colsSelectResult = pimcore_select("cols").getData() %}
  37. {% set hasSliderResult = (pimcore_select("hasSlider").getData() == 'has-slider') %}
  38. {% if editmode %}
  39.     <div class="flex-col offset-bottom-single">
  40.         <div class="col xs-12 m-6 l-3">
  41.             <span class="hint">{{ 'ID für Anchorlinks vergeben' |trans }}</span>
  42.             {{ pimcore_input("brickAnchorIdInput") }}
  43.         </div>
  44.         <div class="col xs-12 m-6 l-3">
  45.             <div class="select-items">
  46.                 <div class="hint">
  47.                     {{ 'Kein Abstand nach oben?' |trans }}
  48.                 </div>
  49.                 {{ spacingSelect }}
  50.             </div>
  51.         </div>
  52.         <div class="col xs-12 m-6 l-3">
  53.             <span class="hint">{{ 'Teaser Content Breite:' |trans }}</span>
  54.             {{ colSelect }}
  55.         </div>
  56.         <div class="col xs-12 m-6 l-3">
  57.             <span class="hint">{{ ' Darstellungsart:' |trans }}</span>
  58.             {{ hasSliderSelect }}
  59.         </div>
  60.     </div>
  61. {% endif %}
  62.     {% if editmode %}
  63. <div class="admin teaser-panel-row teaser-product-story">
  64.     {% endif %}
  65.     <div id="{{ brickAnchorId }}" class="section {{ noSpacingTop }}">
  66.         <div class="panel {% if editmode %} {% else %}{{ pimcore_select("hasSlider").getData() }} {% endif %}{% if colsSelectResult == 'xs-12 m-6 half' %}half{% elseif colsSelectResult == 'xs-12 full' %}full{% else %}one-third{% endif %}">
  67.             <div class="main-content">
  68.                 <div class="panel-container">
  69.                     <div class="panel-content">
  70.                         <div class="flex-col panel-slider">
  71.                             {% if pimcore_block('contentblock').isEmpty() and editmode %}
  72.                                 <span class="hint">{{ 'Bitte wählen Sie die Anzahl der Teaser'|trans }}</span>
  73.                             {% endif %}
  74.                             {% for i in pimcore_iterate_block(pimcore_block('contentblock')) %}
  75.                                 {% set productLink = pimcore_href("selectProduct").getElement() %}
  76.                                 <div class="col {{ colsSelectResult }}">
  77.                                     {% if editmode %}
  78.                                         <div class="flex-col offset-bottom-single config-row-{{ colsSelectResult == 'xs-12 full' ? 'full' : 'half' }}">
  79.                                             <div class="col">
  80.                                                 <div class="offset-top-single">
  81.                                                     <span class="hint">{{ 'Schärfegrad angeben?' |trans }}</span>
  82.                                                     {{ 'Ja' |trans }}{{ pimcore_checkbox("heatCheckbox", {
  83.                                                         "reload" : true }) }}
  84.                                                 </div>
  85.                                                 <div class="offset-top-single">
  86.                                                     <span class="hint">{{ 'Verlinkung zu bestehendem Produkt?'|trans }}</span>
  87.                                                     {{ pimcore_href("selectProduct", {
  88.                                                         "types": ["object"],
  89.                                                         "subtypes": {
  90.                                                             "types": ["object"],
  91.                                                         },
  92.                                                         "classes": ["ProductFood", "ProductClothing", "Product"],
  93.                                                         "width": 300,
  94.                                                         "reload": true
  95.                                                     }) }}
  96.                                                 </div>
  97.                                             </div>
  98.                                             <div class="col">
  99.                                                 <div class="offset-top-single">
  100.                                                     <span class="hint">{{ 'Hintergrundbild festlegen'|trans }}</span>
  101.                                                     {{ pimcore_image("TeaserProductStoryImage", {
  102.                                                         "title": "Drag your image here",
  103.                                                         "thumbnail": "TeaserProductStoryImageFull" ~ bundleName,
  104.                                                         "reload" : true
  105.                                                     }) }}
  106.                                                 </div>
  107.                                             </div>
  108.                                         </div>
  109.                                     {% endif %}
  110.                                     {% if pimcore_href("selectProduct").isEmpty() != true %}
  111.                                         {% set detailViewUri    = pimcore_url(
  112.                                         {
  113.                                         "name": productLink.getName()|sanitized_url,
  114.                                         "articlenumber": productLink.getArticleNumber()
  115.                                         },
  116.                                         "shopHandlerProductDetail"
  117.                                         ) %}
  118.                                     {% endif %}
  119.                                     <div class="teaser story-item">
  120.                                         <div class="teaser-content">
  121.                                             {# background image #}
  122.                                             <div class="teaser-image">
  123.                                                 {# product link #}
  124.                                                 <a href="{{ pimcore_href("selectProduct").isEmpty() != true ? detailViewUri : pimcore_link("productLink").getHref() }}" target="{{ pimcore_link("productLink").getTarget() }}" aria-label="Open Details">
  125.                                                     <div class="image">
  126.                                                         {% if pimcore_image("TeaserProductStoryImage").isEmpty() != true %}
  127.                                                             {# thumbnail #}
  128.                                                             {% if colsSelectResult == 'xs-12 full' %}
  129.                                                                 {{ pimcore_image("TeaserProductStoryImage").getThumbnail("TeaserProductStoryImageFull" ~ bundleName).getHTML() |raw }}
  130.                                                             {% else %}
  131.                                                                 {{ pimcore_image("TeaserProductStoryImage").getThumbnail("TeaserProductStoryImage" ~ bundleName).getHTML() |raw }}
  132.                                                             {% endif %}
  133.                                                             {# heat select #}
  134.                                                             {% if pimcore_checkbox('heatCheckbox').isChecked() %}
  135.                                                                 <div class="heat-select flex-col">
  136.                                                                     {% for i in pimcore_iterate_block(pimcore_block('heatSelect')) %}
  137.                                                                         <span class="icon flame-red"></span>
  138.                                                                     {% endfor %}
  139.                                                                 </div>
  140.                                                             {% endif %}
  141.                                                         {% endif %}
  142.                                                     </div>
  143.                                                 </a>
  144.                                             </div>
  145.                                             {# teaser box #}
  146.                                             <div class="teaser-text-box {% if pimcore_image("TeaserProductStoryBottle") is not empty or pimcore_href("selectProduct").isEmpty() != true %}with-front-img{% endif %}">
  147.                                                 {# product image object #}
  148.                                                 {% if pimcore_href("selectProduct").isEmpty() != true %}
  149.                                                     <div class="teaser-image-front">
  150.                                                         {{ productLink.getProductImage().getThumbnail("TeaserProductStoryBottle" ~ bundleName).getHTML() |raw }}
  151.                                                     </div>
  152.                                                 {# product image assets #}
  153.                                                 {% elseif pimcore_image("TeaserProductStoryBottle") %}
  154.                                                     <div class="teaser-image-front">
  155.                                                         {% if pimcore_image("TeaserProductStoryBottle").isEmpty() and editmode %}
  156.                                                             <span class="hint">{{ 'Produktbild' |trans }}</span>
  157.                                                         {% endif %}
  158.                                                         {{ pimcore_image("TeaserProductStoryBottle", {
  159.                                                             "title": "Drag your image here",
  160.                                                             "thumbnail": "TeaserProductStoryBottle" ~ bundleName,
  161.                                                         }) }}
  162.                                                     </div>
  163.                                                 {% endif %}
  164.                                                 <div class="teaser-text-container">
  165.                                                     {# text box #}
  166.                                                     <div class="title-box">
  167.                                                         <h4>{{ pimcore_input("TeaserProductStoryHeadline", {
  168.                                                                 "placeholder": 'Teaser Headline'
  169.                                                             })|trademark }}
  170.                                                         </h4>
  171.                                                         {{ pimcore_wysiwyg("TeaserProductStoryContent", {
  172.                                                             "placeholder": 'Teaser Content',
  173.                                                             "customConfig": '/bundles/core/js/ckeditor_config.js'
  174.                                                         })|trademark }}
  175.                                                     </div>
  176.                                                     {# teaser link #}
  177.                                                     <div class="{{ editmode != true  ? 'teaser-link'}}">
  178.                                                         {% if pimcore_href("selectProduct").isEmpty() != true %}
  179.                                                             <a class="button" href="{{ detailViewUri }}" aria-label="{{ 'Zum Produkt'|trans }}">
  180.                                                                 <span>
  181.                                                                     {{ 'Zum Produkt'|trans }}
  182.                                                                 </span>
  183.                                                             </a>
  184.                                                         {% else %}
  185.                                                             {% if editmode %}
  186.                                                                 <div style="padding-top: 15px;">
  187.                                                                     {{ pimcore_link('productStoryLink', {'class': "button"}) }}
  188.                                                                 </div>
  189.                                                             {% else %}
  190.                                                                 <a class="button" href="{{ pimcore_link('productStoryLink').getHref() }}" target="{{ pimcore_link("productStoryLink").getTarget() }}" aria-label="{{ pimcore_link('productStoryLink').getText() }}">
  191.                                                                     <span>{{ pimcore_link('productStoryLink').getText() }}</span>
  192.                                                                 </a>
  193.                                                             {% endif %}
  194.                                                         {% endif %}
  195.                                                     </div>
  196.                                                 </div>
  197.                                             </div>
  198.                                         </div>
  199.                                     </div>
  200.                                 </div>
  201.                             {% endfor %}
  202.                         </div>
  203.                     </div>
  204.                 </div>
  205.             </div>
  206.         </div>
  207.     </div>
  208.     {% if editmode %}
  209. </div>
  210. {% endif %}