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