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

Open in your IDE?
  1. {% set productLink = pimcore_href("selectProduct").getElement() %}
  2. {% set spacingSelect %}
  3.     {{ pimcore_checkbox("checkSpacing", {
  4.         "reload": true
  5.     }) }}
  6. {% endset %}
  7. {% set noSpacingTop = '' %}
  8. {% set brickAnchorId = '' %}
  9. {% if pimcore_checkbox('checkSpacing').isChecked() %}
  10.     {% set noSpacingTop = 'no-offset-top' %}
  11. {% endif %}
  12. {% set UID = uniqid() %}
  13. {% if pimcore_input("brickAnchorIdInput") is not empty %}
  14.     {% set brickAnchorId = pimcore_input("brickAnchorIdInput")|lowercase %}
  15. {% endif %}
  16. {% set showNvi = pimcore_checkbox('showNvi') %}
  17. {% set showNviChecked = pimcore_checkbox('showNvi').isChecked() %}
  18. {% if editmode %}
  19.     <div class="flex-col offset-bottom-single">
  20.         <div class="col xs-12 m-6 l-3">
  21.             <span class="hint">{{ 'ID für Anchorlinks vergeben' |trans }}</span>
  22.             {{ pimcore_input("brickAnchorIdInput") }}
  23.         </div>
  24.         <div class="col xs-12 m-6 l-2">
  25.             <div class="select-items">
  26.                 <div class="hint">
  27.                     {{ 'Kein Abstand nach oben?' |trans }}
  28.                 </div>
  29.                 {{ spacingSelect }}
  30.             </div>
  31.         </div>
  32.     </div>
  33.     <div class="flex-col offset-bottom-single">
  34.         <div class="col xs-12 m-6">
  35.             <span class="hint">{{ 'Verlinkung zu bestehendem Produkt?'|trans }}</span>
  36.             {{ pimcore_href("selectProduct", {
  37.                 "types": ["object"],
  38.                 "subtypes": {
  39.                     "types": ["object"],
  40.                 },
  41.                 "width": 300,
  42.                 "reload": true
  43.             }) }}
  44.             <div>
  45.                 <span class="hint">Nährwerte & Zutaten anzeigen?</span>
  46.             </div>
  47.             <div>
  48.                 <div>{{ showNvi | raw }}</div>
  49.                 <small>Nur hier, wenn auch Button angezeigt werden soll.<br/>Sonst über "Teaser Elemente" -&gt; "Nährwerte & Zutaten"</small>
  50.             </div>
  51.         </div>
  52.         <div class="col xs-12 m-6">
  53.             <div class="input-space">
  54.                 <span class="hint">{{ 'Hintergrundbild festlegen' |trans }}</span>
  55.                 {{ pimcore_image("teaserInterstitialImage", {
  56.                     "title": "Drag your image here",
  57.                     "width": 300,
  58.                     "height": 150,
  59.                     "thumbnail": "teaserInterstitialImage" ~ bundleName,
  60.                     "reload": true
  61.                 }) }}
  62.             </div>
  63.         </div>
  64.     </div>
  65. {% endif %}
  66. {% set imageAttributes = {
  67.     "attributes" : {
  68.         "data-speed": "-1"
  69.     }
  70. } %}
  71. {% if productLink == true %}
  72.     {% set detailViewUri    = pimcore_url(
  73.         {
  74.             "name": productLink.getName()|sanitized_url,
  75.             "articlenumber": productLink.getArticleNumber()
  76.         },
  77.         "shopHandlerProductDetail"
  78.     ) %}
  79. {% endif %}
  80. <div id="{{ brickAnchorId }}" class="section {{ noSpacingTop }}">
  81.     <div id="{{ 'uid' ~ UID |raw }}"
  82.          class="teaser-interstitial {% if pimcore_image("teaserInterstitialSmallImage") and pimcore_link('productLink') is not empty %}with-image-absolute{% endif %} has-background-image js">
  83.         <div class="background-image">
  84.             {% if pimcore_image("teaserInterstitialImage").getThumbnail("teaserInterstitialImage" ~ bundleName) is not empty %}
  85.                 <div class="image">
  86.                     {{ pimcore_image("teaserInterstitialImage").getThumbnail("teaserInterstitialImage" ~ bundleName).getHTML(imageAttributes) |raw }}
  87.                 </div>
  88.                 {#IE Fix for thumbnails rendering start#}
  89.                 <script type='text/javascript'>
  90.                     var waitForJQuery = setInterval(function () {
  91.                         if (typeof $ != 'undefined') {
  92.                             $(function() {
  93.                                 if (navigator.userAgent.match(/msie/i) || navigator.userAgent.match(/trident/i) ){
  94.                                     $(".teaser-interstitial .background-image .image").css({
  95.                                         position: "absolute",
  96.                                         width: "100%",
  97.                                         height: "100%",
  98.                                         background: "url( {{ pimcore_image("teaserInterstitialImage").getSrc() }} ) center right 100%/cover no-repeat"
  99.                                     });
  100.                                     $(".teaser-interstitial .background-image img").hide();
  101.                                 }
  102.                             });
  103.                             clearInterval(waitForJQuery);
  104.                         }
  105.                     }, 50);
  106.                 </script>
  107.                 {#IE Fix for thumbnails rendering end#}
  108.             {% endif %}
  109.         </div>
  110.         <div class="content-container flex-col">
  111.             <div class="col teaser-interstitial-content main-content flex-col">
  112.                 <div class="headline-container">
  113.                     <div class="text-only">
  114.                         <div
  115.                             class="headline {% if detailViewUri is not defined and pimcore_link('productLink') is empty %} text-center {% endif %}">
  116.                             {{ pimcore_wysiwyg("teaserInterstitialHeadline", {'placeholder': 'Headline'})|trademark }}
  117.                         </div>
  118.                     </div>
  119.                 </div>
  120.                 {% if pimcore_image("teaserInterstitialSmallImage") is not empty %}
  121.                     <div class="image-container">
  122.                         <div class="image-absolute">
  123.                             <div class="flex-column box-align-center">
  124.                                 {{ pimcore_image("teaserInterstitialSmallImage", {
  125.                                     "title": "Drag your image here",
  126.                                     "thumbnail": "teaserInterstitialSmallImage" ~ bundleName,
  127.                                     "reload": true
  128.                                 }) }}
  129.                             </div>
  130.                         </div>
  131.                     </div>
  132.                 {% endif %}
  133.                 {% if productLink == true %}
  134.                     <div class="button-container text-only">
  135.                         <a class="button btn-default" href="{{ detailViewUri }}" target="{{ pimcore_link("productLink").getTarget() }}">{{ 'Zum Produkt' |trans }}</a>
  136.                     </div>
  137.                 {% elseif pimcore_link("productLink") is not empty %}
  138.                     <div class="button-container text-only">
  139.                         {{ pimcore_link('productLink', {'class': "button btn-default"}) }}
  140.                     </div>
  141.                 {% endif %}
  142.             </div>
  143.         </div>
  144.     </div>
  145.     {% if showNviChecked and productLink == true and  productLink.getClassName() == 'ProductFood' %}
  146.         <div class="section">
  147.             <div class="main-content flex-col">
  148.                 <div class="col xs-12">
  149.                     <div class="bb-flex align-item-start">
  150.                         <div class="bb-flex-2"></div>
  151.                         <div class="product-information-wrapper bb-flex-1">
  152.                             <div class="sales-description-wrapper">
  153.                                 {{ productLink.getSalesDescription() }}
  154.                             </div>
  155.                             <div id="tabber-xyz" class="tabber" data-tab-type="default">
  156.                                 <ul class="tabs resp-tabs-list tab-id">
  157.                                     <li class="resp-tab-item tab-id resp-tab-active" aria-controls="tab-id_tab_item-0" role="tab">{{ 'Nährwerte' | trans }}</li>
  158.                                     <li class="resp-tab-item tab-id" aria-controls="tab-id_tab_item-1" role="tab">{{ 'Zutaten' | trans }}</li>
  159.                                 </ul>
  160.                                 <div class="resp-tabs-container tab-id">
  161.                                     <h3 class="resp-accordion tab-id resp-tab-active" role="tab" aria-controls="tab-id_tab_item-0">{{ 'Nährwerte' | trans }}</h3><div class="tab-content resp-tab-content tab-id resp-tab-content-active" aria-labelledby="tab-id_tab_item-0" style="display:block">
  162.                                         <div class="food-value-container">
  163.                                             {% include 'Partials/NutritionFactsDefault.html.twig' with {
  164.                                                 'product': productLink
  165.                                             } %}
  166.                                         </div>
  167.                                     </div>
  168.                                     <h3 class="resp-accordion tab-id" role="tab" aria-controls="tab-id_tab_item-1">{{ 'Zutaten' | trans }}</h3><div class="tab-content resp-tab-content tab-id" aria-labelledby="tab-id_tab_item-1">
  169.                                         <div class="product-ingredients-container">
  170.                                             <div class="ingredients-item">
  171.                                                 {{ productLink.getIngredientsText() | raw }}
  172.                                             </div>
  173.                                         </div>
  174.                                     </div>
  175.                                 </div>
  176.                             </div>
  177.                         </div>
  178.                     </div>
  179.                 </div>
  180.             </div>
  181.         </div>
  182.     {% endif %}
  183. </div>