src/Develey/MautnerBundle/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-4">
  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-4">
  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 class="col xs-12 m-6 l-4">
  60.                 <span class="hint">{{ 'Wählen Sie die Headline Color' |trans }}</span>
  61.                 <div class="select-items">
  62.                     {% if pimcore_select("headlineColorSelect").isEmpty() %}
  63.                         {% do pimcore_select("headlineColorSelect").setDataFromResource("default") %}
  64.                     {% endif %}
  65.                     {{ pimcore_select("headlineColorSelect", {
  66.                         "store": [
  67.                         ["default", "Weiß"],
  68.                         ["highlighted", "Rot"],
  69.                         ["inverted", "Schwarz"]
  70.                         ],
  71.                         "width": 300,
  72.                         "reload": true
  73.                     }) }}
  74.                 </div>
  75.             </div>
  76.         </div>
  77.     {% endif %}
  78. <div id="{{ brickAnchorId }}" class="stage no-offset-top">
  79.     <div class="stage-image main {% if imageVideoSelectorResult == 'video' %}video-header {% endif %}stage-with-anchor">
  80.         {% if imageVideoSelectorResult == 'image' %}
  81.             <div class="image-wrapper">
  82.                 {% if pimcore_image("mainStage").getThumbnail("mainStageBackground" ~ bundleName) is not empty %}
  83.                     {{ pimcore_image("mainStage").getThumbnail("mainStageBackground" ~ bundleName).getHTML() |raw }}
  84.                     {#IE Fix for thumbnails rendering start#}
  85.                     <script type='text/javascript'>
  86.                         var waitForJQuery = setInterval(function () {
  87.                             if (typeof $ != 'undefined') {
  88.                                 $(function() {
  89.                                     if (navigator.userAgent.match(/msie/i) || navigator.userAgent.match(/trident/i) ){
  90.                                         $(".stage-image.main .image-wrapper").css({
  91.                                             position: "absolute",
  92.                                             width: "100%",
  93.                                             height: "100%",
  94.                                             background: "url( {{ pimcore_image("mainStage").getSrc() }} ) center right 100%/cover no-repeat"
  95.                                         });
  96.                                         $(".stage-image.main .image-wrapper img").hide();
  97.                                     }
  98.                                 });
  99.                                 clearInterval(waitForJQuery);
  100.                             }
  101.                         }, 50);
  102.                     </script>
  103.                     {#IE Fix for thumbnails rendering end#}
  104.                 {% endif %}
  105.             </div>
  106.         {% endif %}
  107.         {% if imageVideoSelectorResult == 'video' %}
  108.             {% set videoIDResult = pimcore_input("youtubeID") %}
  109.             {% set videoID = 'uid' ~ UID |raw %}
  110.             <div class="video-wrapper">
  111.                 <div class="iframe-container">
  112.                     <div id="{{ videoID }}" class="mute-yt-player-stage" data-video-id-result="{{ videoIDResult }}"></div>
  113.                 </div>
  114.             </div>
  115.             {% if not editmode %}
  116.                 <script type='text/javascript'>
  117.                   var waitForJQuery = setInterval(function () {
  118.                     if (typeof $ != 'undefined') {
  119.                       $(function() {
  120.                         // video stage with image on mobile
  121.                         if (($(window).width()) < 768) {
  122.                             var ytImageDefault = 'https://img.youtube.com/vi/' + $('.mute-yt-player-stage').data("videoIdResult") + '/maxresdefault.jpg';
  123.                             $('.mute-yt-player-stage').css('background-image', 'url(' + ytImageDefault + ')');
  124.                         }
  125.                         else {
  126.                             $('#{{ videoID }}').each(function () {
  127.                                 initYoutubeVideoPLayerContainerStage($(this).attr('id'), $(this).data("videoIdResult"));
  128.                             });
  129.                         }
  130.                       });
  131.                         clearInterval(waitForJQuery);
  132.                       }
  133.                     }, 50);
  134.                 </script>
  135.             {% endif %}
  136.         {% endif %}
  137.         <div class="text-container">
  138.             <div class="main-content">
  139.                 <div class="text">
  140.                     <div class="special-headline  {{ pimcore_select("headlineColorSelect") }}">
  141.                         <h1>
  142.                             <span class="special-headline-first">
  143.                                 {{ pimcore_input("mainStageHeadlineOne", {
  144.                                     "placeholder": 'Headline Part 1'
  145.                                 })|trademark }}
  146.                             </span>
  147.                             <span class="special-headline-second">
  148.                                 {{ pimcore_input("mainStageHeadlineTwo", {
  149.                                     "placeholder": 'Headline Part 2'
  150.                                 })|trademark }}
  151.                             </span>
  152.                             <span class="special-headline-third">
  153.                                 {{ pimcore_input("mainStageHeadlineThree", {
  154.                                     "placeholder": 'Headline Part 3'
  155.                                 })|trademark }}
  156.                             </span>
  157.                         </h1>
  158.                     </div>
  159.                     {% if imageVideoSelectorResult == 'video' %}
  160.                         {{ pimcore_link('productLink', {'class': "button btn-outline"}) }}
  161.                     {% else %}
  162.                         <div class="cta-row">
  163.                             {{ pimcore_link('productLink', {'class': "button btn-default"}) }}
  164.                         </div>
  165.                     {% endif %}
  166.                 </div>
  167.             </div>
  168.             <div class="with-anchor">
  169.                 <a href="#content-section" class="content-anchor offset-top"></a>
  170.             </div>
  171.         </div>
  172.     </div>
  173. </div>