src/Develey/BbqueBundle/Resources/views/Areas/MainStageCarousel/view.html.twig line 1

Open in your IDE?
  1. {% set brickAnchorId = '' %}
  2. {% if pimcore_input("brickAnchorIdInput") is not empty %}
  3.     {% set brickAnchorId = pimcore_input("brickAnchorIdInput")|lowercase %}
  4. {% endif %}
  5. {% set carouselElements = pimcore_block('carouselSlides') %}
  6. {% set variant = pimcore_checkbox("variant").isChecked() %}
  7. {% if editmode %}
  8.     <div class="flex-col offset-bottom-single">
  9.         <div class="col xs-12 m-6 l-4">
  10.             <span class="hint">{{ 'ID für Anchorlinks vergeben' |trans }}</span>
  11.             {{ pimcore_input("brickAnchorIdInput") }}
  12.         </div>
  13.         <div class="col xs-12 m-6 l-4">
  14.             <span class="hint">Layout Variante</span>
  15.             {{ pimcore_checkbox("variant", {"reload": true}) }}Bilder <strong>nicht</strong> beschneiden?
  16.         </div>
  17.         <div class="col xs-12 m-6 l-2">
  18.             <span class="hint">Autoplay</span>
  19.             {{ pimcore_checkbox("autoplay") }}Autoplay aktivieren?
  20.             <div><small>(Slide wechselt dann automatisch)</small></div>
  21.         </div>
  22.         <div class="col xs-12 m-6 l-2">
  23.             <span class="hint">Autoplay Zeit (1000 = 1 Sekunde)</span>
  24.             {{ pimcore_input("autoplayTime", {"placeholder": "4000"}) }}
  25.         </div>
  26.     </div>
  27.     <div class="offset-bottom-single">
  28.         <strong>Carousel</strong>
  29.         {% for i in pimcore_iterate_block(pimcore_block('carouselSlides')) %}
  30.             {% set imageVideoSelectorResult = pimcore_select("imageVideoSelector").getData() %}
  31.             <div>
  32.                 <span><strong>{{ loop.index }}. Slide</strong></span>
  33.                 <div class="flex-col offset-bottom-single">
  34.                     <div class="col xs-12 m-4 l-4">
  35.                         {% if pimcore_select("imageVideoSelector").isEmpty() %}
  36.                             {% do pimcore_select("imageVideoSelector").setDataFromResource("image") %}
  37.                         {% endif %}
  38.                         <span class="hint">{{ 'Möchten Sie ein Bild oder Video integrieren?' |trans }}</span>
  39.                         <div class="select-items">
  40.                             {% if variant == '1' %}
  41.                                 In der Layout Variante ohne Beschnitt sind nur Bilder möglich.<br/>&nbsp;
  42.                             {% else %}
  43.                                 {{ pimcore_select("imageVideoSelector", {
  44.                                     "store": [
  45.                                         ["image", "Bild"],
  46.                                         ["video", "Video"]
  47.                                     ],
  48.                                     "width": 300,
  49.                                     "reload": true
  50.                                 }) }}
  51.                             {% endif %}
  52.                         </div>
  53.                         <div>
  54.                             &nbsp;<br/>
  55.                             <div class="flex-col">
  56.                                 <div class="xs-4 m-4 l-4">
  57.                                     <div class="hint">Link:</div>
  58.                                 </div>
  59.                                 <div class="xs-8 m-8 l-8">
  60.                                     {{ pimcore_link('productLink') }}
  61.                                 </div>
  62.                             </div>
  63.                             <div class="flex-col">
  64.                                 <div class="xs-4 m-4 l-4"></div>
  65.                                 <div class="xs-8 m-8 l-8">
  66.                                     {{ pimcore_checkbox('slideAsLink') }}Ganzer Slide ist Link (ohne Button)
  67.                                 </div>
  68.                             </div>
  69.                         </div>
  70.                     </div>
  71.                     <div class="col xs-12 m-4 l-4">
  72.                         {% if imageVideoSelectorResult == 'video' and (variant != '1') %}
  73.                             <span class="hint">{{ 'Youtube ID eingeben' |trans }}</span>
  74.                             {{ pimcore_input("youtubeID", {
  75.                                 "width": 320,
  76.                                 "reload": true
  77.                             }
  78.                             ) }}
  79.                         {% else %}
  80.                             <span class="hint">{{ 'Hintergrundbild festlegen' |trans }}</span>
  81.                             {{ pimcore_image("mainStage", {
  82.                                 "title": "Drag your image here",
  83.                                 "width": 320,
  84.                                 "reload": true
  85.                             }) }}
  86.                         {% endif %}
  87.                     </div>
  88.                     <div class="col xs-12 m-4 l-4">
  89.                         <div class="hint">Sublines:</div>
  90.                         <div class="text-center">
  91.                             {{ pimcore_input("mainStageHeadlineTwo", {
  92.                                 "placeholder": '1. Subline / Part 2'
  93.                             })|trademark }}
  94.                         </div>
  95.                         <div class="text-center" style="margin-top:5px">
  96.                             {{ pimcore_input("mainStageHeadlineThree", {
  97.                                 "placeholder": '2. Subline / Part 3'
  98.                             })|trademark }}
  99.                         </div>
  100.                         <div class="hint" style="margin-top:8px">Headline (H1 oder H2):</div>
  101.                         <div style="padding-bottom:7px">{{ pimcore_checkbox("setH1") }}als H1 setzten</div>
  102.                         <div class="text-center">
  103.                             {{ pimcore_input("mainStageHeadlineOne", {
  104.                                 "placeholder": 'Headline / Part 1'
  105.                             })|trademark }}
  106.                         </div>
  107.                     </div>
  108.                 </div>
  109.             </div>
  110.         {% endfor %}
  111.     </div>
  112.     <hr/>
  113. {% else %}
  114.     {% if pimcore_checkbox("variant").isChecked() %}
  115.         {% set variant = '1' %}
  116.     {% endif %}
  117.     {% set thumbnailName = "mainStageBackground" ~ bundleName %}
  118.     {% if variant == '1' or pimcore_checkbox("variant").value == true %}
  119.         {% set thumbnailName = "mainStageCarouselNoCover" %}
  120.     {% endif %}
  121.     {% set thumbnailName = "mainStageCarouselNoCover" %}
  122.     {% if carouselElements is defined %}
  123.         {% set slideCount = carouselElements.getCount() %}
  124.         {% if slideCount > 0 %}
  125.             <div id="{{ brickAnchorId }}" class="{% if variant == '1' %}main-stage-carousel_noCover{% endif %}{% if slideCount == 1 %} main-stage-carousel_single-item{% endif %}">
  126.                 {% if slideCount > 1 %}
  127.                     {% set autoplayTime = pimcore_input("autoplayTime") %}
  128.                     {% if autoplayTime is empty %}
  129.                         {% set autoplayTime = '4000' %}
  130.                     {% endif %}
  131.                 <div
  132.                     class="main-stage-carousel main-stage_loading {% if pimcore_checkbox('autoplay').isChecked() %} main-stage-carousel_autoplay{% else %} main-stage-carousel_single{% endif %}"
  133.                     data-slick='{"autoplaySpeed": {{ autoplayTime }}}'
  134.                 >
  135.                     {% endif %}
  136.                     {% for i in pimcore_iterate_block(pimcore_block('carouselSlides')) %}
  137.                         {% set imageVideoSelectorResult = pimcore_select("imageVideoSelector").getData() %}
  138.                         {% set hTag = 'h2' %}
  139.                         {% if pimcore_checkbox("setH1").isChecked()  %}
  140.                             {% set hTag = 'h1' %}
  141.                         {% endif %}
  142.                         {% set productLink = pimcore_link('productLink', {'class': "button btn-default w-auto"}) %}
  143.                         {% set productLinkHref = productLink.getHref() %}
  144.                         {% set slideAsLink = pimcore_checkbox("slideAsLink").isChecked() %}
  145.                         <div class="main-stage-slide stage stage-carousel">
  146.                             <div class="stage-image main {% if imageVideoSelectorResult == 'video' %}video-header {% endif %}stage-with-anchor">
  147.                                 {% if imageVideoSelectorResult == 'video' and (variant != '1') %}
  148.                                     {# Slide content is video #}
  149.                                     {% set videoIDResult = pimcore_input("youtubeID") %}
  150.                                     {% set videoID = 'uid' ~ uniqid()  |raw %}
  151.                                     <div class="video-wrapper">
  152.                                         <div class="iframe-container">
  153.                                             <div id="{{ videoID }}" class="mute-yt-player-stage" data-video-id-result="{{ videoIDResult }}"></div>
  154.                                         </div>
  155.                                     </div>
  156.                                     <script>
  157.                                         window.onload = function () {
  158.                                             // video stage with image on mobile
  159.                                             if (($(window).width()) < 768) {
  160.                                                 var ytImageDefault = 'https://img.youtube.com/vi/' + $('.mute-yt-player-stage').data("videoIdResult") + '/maxresdefault.jpg';
  161.                                                 $('.mute-yt-player-stage').css('background-image', 'url(' + ytImageDefault + ')');
  162.                                             } else {
  163.                                                 $('#{{ videoID }}').each(function () {
  164.                                                     initYoutubeVideoPLayerContainerStage($(this).attr('id'), $(this).data("videoIdResult"));
  165.                                                 });
  166.                                             }
  167.                                         }
  168.                                     </script>
  169.                                 {% else %}
  170.                                     {# Slide content is image #}
  171.                                     <div class="image-wrapper">
  172.                                         {% if pimcore_image("mainStage").getThumbnail(thumbnailName) is not empty %}
  173.                                             {{ pimcore_image("mainStage").getThumbnail(thumbnailName).getHTML() |raw }}
  174.                                         {% endif %}
  175.                                     </div>
  176.                                 {% endif %}
  177.                                 {# Slide Headlines #}
  178.                                 <div class="text-container">
  179.                                     <div class="main-content">
  180.                                         <div class="text">
  181.                                             <div class="special-headline">
  182.                                                 <div class="main-stage-carousel_first">
  183.                                                     {{ pimcore_input("mainStageHeadlineTwo")|trademark }}
  184.                                                 </div>
  185.                                                 <div class="main-stage-carousel_second">
  186.                                                     {{ pimcore_input("mainStageHeadlineThree")|trademark }}
  187.                                                 </div>
  188.                                                 {{ ('<' ~ hTag ~ ' class="main-stage-carousel_third">') | raw }}
  189.                                                 {{ pimcore_input("mainStageHeadlineOne")|trademark }}
  190.                                                 {{ ('</' ~ hTag ~ '>') | raw }}
  191.                                             </div>
  192.                                             {% if slideAsLink != '1' %}
  193.                                                 {% if imageVideoSelectorResult == 'image' %}
  194.                                                     <div class="cta-row">
  195.                                                         {% endif %}
  196.                                                         <div class="text-center" style="margin-top:4px">{{ productLink | raw }}</div>
  197.                                                         {% if imageVideoSelectorResult == 'image' %}
  198.                                                     </div>
  199.                                                 {% endif %}
  200.                                             {% endif %}
  201.                                         </div>
  202.                                     </div>
  203.                                     <div class="with-anchor">
  204.                                         <a href="#content-section" class="content-anchor offset-top"></a>
  205.                                     </div>
  206.                                 </div>
  207.                                 {% if slideAsLink == '1' and (not productLink.getHref() is empty) %}
  208.                                     <a class="main-stage-carousel_slide-link" href="{{ productLink.getHref() }}"></a>
  209.                                 {% endif %}
  210.                                 {# Slide end #}
  211.                             </div>
  212.                         </div>
  213.                     {% endfor %}
  214.                     {% if slideCount > 1 %}
  215.                 </div>
  216.                 {% endif %}
  217.             </div>
  218.         {% endif %}
  219.     {% endif %}
  220. {% endif %}