src/Develey/MautnerSpezialitaetenBundle/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">
  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.                     {% do pimcore_select("imageVideoSelector").setDataFromResource("image") %}
  39.                 </div>
  40.             </div>
  41.             <div class="col xs-12 m-6">
  42.                 {% if imageVideoSelectorResult == 'image' or pimcore_select("imageVideoSelector").isEmpty() %}
  43.                     <span class="hint">{{ 'Hintergrundbild festlegen' |trans }}</span>
  44.                     {{ pimcore_image("mainStage", {
  45.                         "title": "Drag your image here",
  46.                         "thumbnail": "mainStageBackground",
  47.                         "width": 300,
  48.                         "height": 150,
  49.                         "reload": true
  50.                     }) }}
  51.                 {% endif %}
  52.                 {% if imageVideoSelectorResult == 'video' %}
  53.                     <span class="hint">{{ 'Youtube ID eingeben' |trans }}</span>
  54.                     {{ pimcore_input("youtubeID", {
  55.                         "width": 300,
  56.                         "reload": true
  57.                     }
  58.                     ) }}
  59.                 {% endif %}
  60.             </div>
  61.         </div>
  62.     {% endif %}
  63. <div id="{{ brickAnchorId }}" class="stage">
  64.     <div class="stage-image main {% if imageVideoSelectorResult == 'video' %}video-header {% endif %}stage-with-anchor">
  65.         {% if imageVideoSelectorResult == 'image' %}
  66.             <div class="image-wrapper">
  67.                 {% if pimcore_image("mainStage").getThumbnail("mainStageBackground" ~ bundleName) is not empty %}
  68.                     {{ pimcore_image("mainStage").getThumbnail("mainStageBackground" ~ bundleName).getHTML() |raw }}
  69.                 {% endif %}
  70.             </div>
  71.             {#IE Fix for thumbnails rendering start#}
  72.             <script type='text/javascript'>
  73.                 var waitForJQuery = setInterval(function () {
  74.                     if (typeof $ != 'undefined') {
  75.                         $(function() {
  76.                             if (navigator.userAgent.match(/msie/i) || navigator.userAgent.match(/trident/i) ){
  77.                                 $(".stage.main .image-wrapper").css({
  78.                                     position: "absolute",
  79.                                     width: "100%",
  80.                                     height: "100%",
  81.                                     background: "url( {{ pimcore_image("mainStage").getSrc() }} ) center right 100%/cover no-repeat"
  82.                                 });
  83.                                 $(".stage.main .image-wrapper img").hide();
  84.                             }
  85.                         });
  86.                         clearInterval(waitForJQuery);
  87.                     }
  88.                 }, 50);
  89.             </script>
  90.             {#IE Fix for thumbnails rendering end#}
  91.         {% endif %}
  92.         {% if imageVideoSelectorResult == 'video' %}
  93.             {% set videoIDResult = pimcore_input("youtubeID") %}
  94.             {% set videoID = 'uid' ~ UID |raw %}
  95.             <div class="video-wrapper">
  96.                 <div class="iframe-container">
  97.                     <div id="{{ videoID }}" class="mute-yt-player-stage" data-video-id-result="{{ videoIDResult }}"></div>
  98.                 </div>
  99.             </div>
  100.         {% if not editmode %}
  101.             <script>
  102.                 window.onload = function () {
  103.                     // video stage with image on mobile
  104.                     if (($(window).width()) < 768) {
  105.                         var ytImageDefault = 'https://img.youtube.com/vi/' + $('.mute-yt-player-stage').data("videoIdResult") + '/maxresdefault.jpg';
  106.                         $('.mute-yt-player-stage').css('background-image', 'url(' + ytImageDefault + ')');
  107.                     }
  108.                     else {
  109.                         $('#{{ videoID }}').each(function () {
  110.                             initYoutubeVideoPLayerContainerStage($(this).attr('id'), $(this).data("videoIdResult"));
  111.                         });
  112.                     }
  113.                 }
  114.             </script>
  115.         {% endif %}
  116.         {% endif %}
  117.         <div class="text-container">
  118.             <div class="main-content">
  119.                 <div class="text">
  120.                     <div class="uppercase special-headline">
  121.                         <h1>
  122.                                 <span>{{ pimcore_input("mainStageHeadlineOne", {
  123.                                         "placeholder": 'Headline Part 1'
  124.                                     })|trademark }}</span>
  125.                             {{ pimcore_input("mainStageHeadlineTwo", {
  126.                                 "placeholder": 'Headline Part 2'
  127.                             })|trademark }}
  128.                             <strong>{{ pimcore_input("mainStageHeadlineThree", {
  129.                                     "placeholder": 'Headline Part 3'
  130.                                 })|trademark }}</strong>
  131.                         </h1>
  132.                     </div>
  133.                     {% if imageVideoSelectorResult == 'video' %}
  134.                         {{ pimcore_link('productLink', {'class': "button btn-outline"}) }}
  135.                     {% else %}
  136.                         <div class="cta-row">
  137.                             {{ pimcore_link('productLink', {'class': "button btn-default"}) }}
  138.                             {{ pimcore_link('productLinkSecondary', {'class': "button btn-default"}) }}
  139.                         </div>
  140.                     {% endif %}
  141.                 </div>
  142.             </div>
  143.         </div>
  144.     </div>
  145. </div>