src/Develey/LoewensenfBundle/Resources/views/Areas/MainStage/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 imageVideoSelectorResult = pimcore_select("imageVideoSelector").getData() %}
  16.     {% if editmode %}
  17.         <div class="flex-col offset-bottom-single">
  18.             <div class="col xs-12 m-6 l-3">
  19.                 <span class="hint">{{ 'ID für Anchorlinks vergeben' |trans }}</span>
  20.                 {{ pimcore_input("brickAnchorIdInput") }}
  21.             </div>
  22.         </div>
  23.         <div class="flex-col offset-bottom-single">
  24.             <div class="col xs-12 m-6 l-6">
  25.                 {% if pimcore_select("imageVideoSelector").isEmpty() %}
  26.                     {% do pimcore_select("imageVideoSelector").setDataFromResource("image") %}
  27.                 {% endif %}
  28.                 <span class="hint">{{ 'Möchten Sie ein Bild oder Video integrieren?' |trans }}</span>
  29.                 <div class="select-items">
  30.                     {{ pimcore_select("imageVideoSelector", {
  31.                         "store": [
  32.                         ["image", "Bild"],
  33.                         ["video", "Video"]
  34.                         ],
  35.                         "width": 300,
  36.                         "reload": true
  37.                     }) }}
  38.                 </div>
  39.             </div>
  40.             <div class="col xs-12 m-6 l-6">
  41.                 {% if imageVideoSelectorResult != 'video' %}
  42.                     <span class="hint">{{ 'Hintergrundbild festlegen' |trans }}</span>
  43.                     {{ pimcore_image("mainStage", {
  44.                         "title": "Drag your image here",
  45.                         "thumbnail": "mainStageBackground" ~ bundleName,
  46.                         "width": 300,
  47.                         "reload": true
  48.                     }) }}
  49.                 {% endif %}
  50.                 {% if imageVideoSelectorResult == 'video' %}
  51.                     <span class="hint">{{ 'Youtube ID eingeben' |trans }}</span>
  52.                     {{ pimcore_input("youtubeID", {
  53.                         "width": 300,
  54.                         "reload": true
  55.                     }
  56.                     ) }}
  57.                 {% endif %}
  58.             </div>
  59.         </div>
  60.     {% endif %}
  61. <div id="{{ brickAnchorId }}" class="stage">
  62.     <div class="stage-image main {% if imageVideoSelectorResult == 'video' %}video-header {% endif %}stage-with-anchor">
  63.         {% if imageVideoSelectorResult == 'image' %}
  64.             <div class="image-wrapper">
  65.                 {% if pimcore_image("mainStage").getThumbnail("mainStageBackground" ~ bundleName) is not empty %}
  66.                     {{ pimcore_image("mainStage").getThumbnail("mainStageBackground" ~ bundleName).getHTML() |raw }}
  67.                     {#IE Fix for thumbnails rendering start#}
  68.                     <script type='text/javascript'>
  69.                         var waitForJQuery = setInterval(function () {
  70.                             if (typeof $ != 'undefined') {
  71.                                 $(function() {
  72.                                     if (navigator.userAgent.match(/msie/i) || navigator.userAgent.match(/trident/i) ){
  73.                                         $(".stage-image.main .image-wrapper").css({
  74.                                             position: "absolute",
  75.                                             width: "100%",
  76.                                             height: "100%",
  77.                                             background: "url( {{ pimcore_image("mainStage").getSrc() }} ) center right 100%/cover no-repeat"
  78.                                         });
  79.                                         $(".stage-image.main .image-wrapper img").hide();
  80.                                     }
  81.                                 });
  82.                                 clearInterval(waitForJQuery);
  83.                             }
  84.                         }, 50);
  85.                     </script>
  86.                     {#IE Fix for thumbnails rendering end#}
  87.                 {% endif %}
  88.             </div>
  89.         {% endif %}
  90.         {% if imageVideoSelectorResult == 'video' %}
  91.             {% set videoIDResult = pimcore_input("youtubeID") %}
  92.             {% set videoID = 'uid' ~ UID |raw %}
  93.             <div class="video-wrapper">
  94.                 <div class="iframe-container">
  95.                     <div id="{{ videoID }}" class="mute-yt-player-stage" data-video-id-result="{{ videoIDResult }}"></div>
  96.                 </div>
  97.             </div>
  98.         {% if not editmode %}
  99.             <script>
  100.                 window.onload = function () {
  101.                     // video stage with image on mobile
  102.                     if (($(window).width()) < 768) {
  103.                         var ytImageDefault = 'https://img.youtube.com/vi/' + $('.mute-yt-player-stage').data("videoIdResult") + '/maxresdefault.jpg';
  104.                         $('.mute-yt-player-stage').css('background-image', 'url(' + ytImageDefault + ')');
  105.                     }
  106.                     else {
  107.                         $('#{{ videoID }}').each(function () {
  108.                             initYoutubeVideoPLayerContainerStage($(this).attr('id'), $(this).data("videoIdResult"));
  109.                         });
  110.                     }
  111.                 }
  112.             </script>
  113.         {% endif %}
  114.         {% endif %}
  115.         <div class="text-container">
  116.             <div class="main-content">
  117.                 {% if pimcore_image("mainStageProductImage") is not empty %}
  118.                     {% set mainStagePackshot = 'packshot' %}
  119.                 {% else %}
  120.                     {% set mainStagePackshot = 'without' %}
  121.                 {% endif %}
  122.                 <div class="text {{ mainStagePackshot }}">
  123.                     <div class="special-headline">
  124.                         <h1>
  125.                             {% if not editmode and pimcore_input("mainStageHeadlineOne") is not empty %}
  126.                             <div class="special-headline-first">
  127.                                 <div class="highlight-background">
  128.                                     <span>
  129.                             {% endif %}
  130.                                         {{ pimcore_input("mainStageHeadlineOne", {
  131.                                             "placeholder": 'Headline Part 1'
  132.                                         })|trademark }}
  133.                             {% if not editmode and pimcore_input("mainStageHeadlineOne") is not empty %}
  134.                                     </span>
  135.                                 </div>
  136.                             </div>
  137.                             {% endif %}
  138.                             {% if not editmode and pimcore_input("mainStageHeadlineTwo") is not empty %}
  139.                             <div class="special-headline-second">
  140.                                 <div class="highlight-background">
  141.                                     <span>
  142.                             {% endif %}
  143.                                         {{ pimcore_input("mainStageHeadlineTwo", {
  144.                                             "placeholder": 'Headline Part 2'
  145.                                         })|trademark }}
  146.                             {% if not editmode and pimcore_input("mainStageHeadlineTwo") is not empty %}
  147.                                     </span>
  148.                                 </div>
  149.                             </div>
  150.                             {% endif %}
  151.                             {% if not editmode and pimcore_input("mainStageHeadlineThree") is not empty %}
  152.                             <div class="special-headline-third">
  153.                                 <div class="highlight-background">
  154.                                     <span class="highlight-text">
  155.                             {% endif %}
  156.                                         {{ pimcore_input("mainStageHeadlineThree", {
  157.                                             "placeholder": 'Headline Part 3'
  158.                                         })|trademark }}
  159.                             {% if not editmode and pimcore_input("mainStageHeadlineThree") is not empty %}
  160.                                     </span>
  161.                                 </div>
  162.                             </div>
  163.                             {% endif %}
  164.                         </h1>
  165.                     </div>
  166.                     {% if imageVideoSelectorResult == 'video' %}
  167.                         {{ pimcore_link('productLink', {'class': "button btn-outline"}) }}
  168.                     {% else %}
  169.                         <div class="cta-row">
  170.                             {{ pimcore_link('productLink', {'class': "button btn-default"}) }}
  171.                         </div>
  172.                     {% endif %}
  173.                 </div>
  174.                 <div class="product-image-wrapper">
  175.                     <div class="product-image">
  176.                         {{ pimcore_image("mainStageProductImage", {
  177.                             "title": "Drag your image here",
  178.                             "thumbnail": "mainStageProductImage" ~ bundleName
  179.                         }) }}
  180.                     </div>
  181.                 </div>
  182.             </div>
  183.             <div class="with-anchor">
  184.                 <a href="#content-section" class="content-anchor offset-top"></a>
  185.             </div>
  186.         </div>
  187.     </div>
  188. </div>