src/Develey/MautnerFoodserviceBundle/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>
  117.                 window.onload = function () {
  118.                     // video stage with image on mobile
  119.                     if (($(window).width()) < 768) {
  120.                         var ytImageDefault = 'https://img.youtube.com/vi/' + $('.mute-yt-player-stage').data("videoIdResult") + '/maxresdefault.jpg';
  121.                         $('.mute-yt-player-stage').css('background-image', 'url(' + ytImageDefault + ')');
  122.                     }
  123.                     else {
  124.                         $('#{{ videoID }}').each(function () {
  125.                             initYoutubeVideoPLayerContainerStage($(this).attr('id'), $(this).data("videoIdResult"));
  126.                         });
  127.                     }
  128.                 }
  129.             </script>
  130.         {% endif %}
  131.         {% endif %}
  132.         <div class="text-container">
  133.             <div class="main-content">
  134.                 <div class="text">
  135.                     <div class="special-headline  {{ pimcore_select("headlineColorSelect") }}">
  136.                         <h1>
  137.                             <span class="special-headline-first">
  138.                                 {{ pimcore_input("mainStageHeadlineOne", {
  139.                                     "placeholder": 'Headline Part 1'
  140.                                 })|trademark }}
  141.                             </span>
  142.                             <span class="special-headline-second">
  143.                                 {{ pimcore_input("mainStageHeadlineTwo", {
  144.                                     "placeholder": 'Headline Part 2'
  145.                                 })|trademark }}
  146.                             </span>
  147.                             <span class="special-headline-third">
  148.                                 {{ pimcore_input("mainStageHeadlineThree", {
  149.                                     "placeholder": 'Headline Part 3'
  150.                                 })|trademark }}
  151.                             </span>
  152.                         </h1>
  153.                     </div>
  154.                     {% if imageVideoSelectorResult == 'video' %}
  155.                         {{ pimcore_link('productLink', {'class': "button btn-outline"}) }}
  156.                     {% else %}
  157.                         <div class="cta-row">
  158.                             {{ pimcore_link('productLink', {'class': "button btn-default"}) }}
  159.                         </div>
  160.                     {% endif %}
  161.                 </div>
  162.             </div>
  163.             <div class="with-anchor">
  164.                 <a href="#content-section" class="content-anchor offset-top"></a>
  165.             </div>
  166.         </div>
  167.     </div>
  168. </div>