src/CoreBundle/Resources/views/Areas/TextBackground/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 productLink = pimcore_href("selectProduct").getElement() %}
  16. {% set UID = uniqid() %}
  17.     {% if editmode %}
  18.         <div class="flex-col offset-bottom-single">
  19.             <div class="col xs-12 m-6 l-3">
  20.                 <span class="hint">{{ 'ID für Anchorlinks vergeben' |trans }}</span>
  21.                 {{ pimcore_input("brickAnchorIdInput") }}
  22.             </div>
  23.             <div class="col xs-12 m-6 l-2">
  24.                 <div class="select-items">
  25.                     <div class="hint">
  26.                         {{ 'Kein Abstand nach oben?' |trans }}
  27.                     </div>
  28.                     {{ spacingSelect }}
  29.                 </div>
  30.             </div>
  31.         </div>
  32.         <div class="flex-col offset-bottom-single">
  33.             <div class="col xs-12 m-4 l-3">
  34.                 <span class="hint">{{ 'Verlinkung zu bestehendem Produkt?'|trans }}</span>
  35.                 {{ pimcore_href("selectProduct", {
  36.                     "types": ["object"],
  37.                     "subtypes": {
  38.                         "types": ["object"],
  39.                     },
  40.                     "width": 300,
  41.                     "classes": ["ProductFood", "ProductClothing", "Product"],
  42.                     "reload": true
  43.                 }) }}
  44.             </div>
  45.             <div class="col xs-12 m-4 l-3">
  46.                 {% if pimcore_select("headlineType").isEmpty() %}
  47.                     {% do pimcore_select("headlineType").setDataFromResource("h2") %}
  48.                 {% endif %}
  49.                 <span class="hint">{{ 'Headline Typ wählen' |trans }}</span>
  50.                 {{ pimcore_select("headlineType", {
  51.                     "store": [
  52.                     ["h2", "Überschrift h2"],
  53.                     ["h3", "Überschrift h3"],
  54.                     ["h4", "Überschrift h4"]
  55.                     ],
  56.                     "width": 300,
  57.                     "reload": true
  58.                 }) }}
  59.             </div>
  60.             <div class="col xs-12 m-4 l-3">
  61.                 <span class="hint">{{ 'Hintergrundbild festlegen' |trans }}</span>
  62.                 {{ pimcore_image("teaserTextBackground", {
  63.                     "title": "Drag your image here",
  64.                     "width": 300,
  65.                     "height": 150,
  66.                     "thumbnail": "textBackgroundImage" ~ bundleName,
  67.                     "reload": true
  68.                 }) }}
  69.             </div>
  70.         </div>
  71.     {% endif %}
  72.     {% set imageAttributes = {
  73.     "attributes" : {
  74.     "data-speed": "-1"
  75.     }
  76.     } %}
  77.     {% if productLink == true %}
  78.         {% set detailViewUri    = pimcore_url(
  79.         {
  80.         "name": productLink.getName()|sanitized_url,
  81.         "articlenumber": productLink.getArticleNumber()
  82.         },
  83.         "shopHandlerProductDetail"
  84.         ) %}
  85.     {% endif %}
  86.     {% if pimcore_image("teaserTextBackground") is not empty %}
  87.     <div id="{{ brickAnchorId }}" class="section {{ noSpacingTop }}">
  88.         <div id="{{ 'uid' ~ UID |raw }}" class="text-background has-background-image js">
  89.             <div class="background-image">
  90.                 <div class="image">
  91.                     {% if pimcore_image("teaserTextBackground").getThumbnail("textBackgroundImage" ~ bundleName) is not empty %}
  92.                         {{ pimcore_image("teaserTextBackground").getThumbnail("textBackgroundImage" ~ bundleName).getHTML(imageAttributes) |raw }}
  93.                         {#IE Fix for thumbnails rendering start#}
  94.                         <script type='text/javascript'>
  95.                             var waitForJQuery = setInterval(function () {
  96.                                 if (typeof $ != 'undefined') {
  97.                                     $(function() {
  98.                                         if (navigator.userAgent.match(/msie/i) || navigator.userAgent.match(/trident/i) ){
  99.                                             $(".text-background.has-background-image").css({
  100.                                                 position: "absolute",
  101.                                                 width: "100%",
  102.                                                 height: "100%",
  103.                                                 background: "url( {{ pimcore_image("teaserTextBackground").getSrc() }} ) center right 100%/cover no-repeat"
  104.                                             });
  105.                                             $(".text-background.has-background-image img").hide();
  106.                                         }
  107.                                     });
  108.                                     clearInterval(waitForJQuery);
  109.                                 }
  110.                             }, 50);
  111.                         </script>
  112.                         {#IE Fix for thumbnails rendering end#}
  113.                     {% endif %}
  114.                 </div>
  115.             </div>
  116.             <div class="content-container">
  117.                 <div class="main-content flex-col">
  118.                     <div class="col xs-12">
  119.                         <div class="text-only">
  120.                             <div class="headline">
  121.                                 <{{ pimcore_select("headlineType").getData() }}
  122.                                 >{{ pimcore_input("teaserTextBackgroundHeadline", {
  123.                                     "placeholder": 'Headline'
  124.                                 }) }}</{{ pimcore_select("headlineType").getData() }}>
  125.                             <div class="text">
  126.                                 {{ pimcore_wysiwyg("TeaserImageWYSIWYG", {
  127.                                     "placeholder": 'Text',
  128.                                     "customConfig": 'bundles/core/js/ckeditor_config.js'
  129.                                 }) }}
  130.                                 {% if pimcore_href("selectProduct").isEmpty() != true %}
  131.                                     <a class="button btn-default" href="{{ detailViewUri }}">{{ 'Zum Produkt' |trans }}</a>
  132.                                 {% else %}
  133.                                     {{ pimcore_link('productLink', {'class': "button btn-default"}) }}
  134.                                 {% endif %}
  135.                             </div>
  136.                         </div>
  137.                     </div>
  138.                 </div>
  139.             </div>
  140.         </div>
  141.     {% else %}
  142.         <div id="{{ brickAnchorId }}" class="section {{ noSpacingTop }}">
  143.             <div class="text-background has-background">
  144.                 <div class="main-content flex-col">
  145.                     <div class="col xs-12">
  146.                         <div class="text-only">
  147.                             <div class="headline">
  148.                                 <{{ pimcore_select("headlineType") }}
  149.                                 >{{ pimcore_input("teaserTextBackgroundHeadline")|trademark }}</{{ pimcore_select("headlineType") }}>
  150.                         </div>
  151.                         <div class="text">
  152.                             {{ pimcore_wysiwyg("TeaserImageWYSIWYG", {
  153.                                 "customConfig": '/bundles/core/js/ckeditor_config.js'
  154.                             })|trademark }}
  155.                             {% if pimcore_href("selectProduct").isEmpty() != true %}
  156.                                 <a class="button btn-default" href="{{ detailViewUri }}">{{ 'Zum Produkt' |trans }}</a>
  157.                             {% else %}
  158.                                 {{ pimcore_link('productLink', {'class': "button btn-default"}) }}
  159.                             {% endif %}
  160.                         </div>
  161.                     </div>
  162.                 </div>
  163.             </div>
  164.         </div>
  165.         </div>
  166.     {% endif %}
  167.     {% if pimcore_image("teaserTextBackground") is not empty %}
  168. </div>
  169.         </div>
  170.     {% endif %}