templates/module/Gallary/__gallery.html.twig line 1

Open in your IDE?
  1. {% if editmode %}
  2.     {{ include('includes/backend-kopf.html.twig') }}
  3.     {% set tabContentArray = {1: 'Optional', 2: 'Bildauswahl'} %}
  4.     {% set tab = 1 %}
  5.     <div id="content">        
  6.             {% if tabContentArray is defined and tab in tabContentArray|keys %}
  7.                 {{ admin_tabs(tab, tabContentArray) | raw }}
  8.             {% endif %} 
  9.             <section class="tabContent">
  10.                 <p class="hl">Optionale Einstellung:</p>
  11.                 {% set element = 'artikel' %}
  12.                 <div id="{{ element }} ">
  13.                     {{ pimcore_multiselect(element, {
  14.                             'width': 200,
  15.                             'height': 100,
  16.                             'store': [
  17.                                 ['abstand-top', 'Abstand nach oben'],
  18.                                 ['abstand-bottom', 'Abstand nach unten']
  19.                             ]
  20.                         }) }}
  21.                 </div>
  22.             </section>
  23.             {% if tabContentArray is defined and 2 in tabContentArray|keys %}
  24.                 {{ admin_tabs(2, tabContentArray) | raw }}
  25.                 <section class="tabContent">
  26.                      <p class="hl">Optional Headline (H2):</p>
  27.                         {{ pimcore_areablock("AreablockTop", {
  28.                                 "allowed": ["H2"],
  29.                                 "toolbar": false,
  30.                                 "areablock_toolbar": {
  31.                                     "title": "Content Konfiguration",
  32.                                     "width": 274,
  33.                                     "x": 570,
  34.                                     "y": 41,
  35.                                     "xAlign": "left",
  36.                                     "buttonWidth": 270,
  37.                                     "buttonMaxCharacters": 35
  38.                                 }
  39.                             })
  40.                         }}                        
  41.                     <br /><br /><hr /><br /><br />
  42.                     <div style="margin-bottom:4px;margin-top:8px;">Bitte wählen Sie:</div>
  43.                     <br />
  44.                     <div style="margin-bottom:10px;">
  45.                         {% if pimcore_select('gallerySelect').isEmpty() %}
  46.                            {% do pimcore_select('gallerySelect').setDataFromResource('snippet') %}
  47.                         {% endif %}
  48.                             {{ pimcore_select("gallerySelect", {
  49.                                 "store": [
  50.                                     ["snippet", "Zuweisung in der eigene Datei"],
  51.                                     ["object", "Zuweisung per Objekte"]
  52.                                 ],
  53.                                 "width": 300,
  54.                                 "reload": true
  55.                             }) }}
  56.                     </div>
  57.                     {% set showContainerSnippet = "" %} 
  58.                     {% set showContainerObject = "" %}
  59.                     {% if pimcore_select("gallerySelect").getData() == 'object' %}
  60.                        {% set showContainerSnippet =  ' style="position:absolute;left:-9999em"' %}
  61.                     {% elseif pimcore_select("gallerySelect").getData() == 'snippet'%}
  62.                         {% set showContainerObject =  ' style="position:absolute;left:-9999em"' %}
  63.                     {% else %}
  64.                         {% set showContainerObject =  ' style="position:absolute;left:-9999em"' %}
  65.                     {% endif %}
  66.                     <div {{ showContainerSnippet }}>
  67.                          <br /><br /><hr /><br /><br />
  68.                          {% for i in pimcore_block('sliderblock').iterator %}
  69.                                  <p class="hl">Bild: (Breite 1400 x Höhe 1400 Pixel)</p>
  70.                                 <div class="dragdrop"><span class="parentbox">
  71.                                     {{ pimcore_image("sliderBild",  
  72.                                             {"thumbnail": "img-default-edm", 
  73.                                             "title": "Bild hier hereinziehen", 
  74.                                             "width":150, "height":150, 
  75.                                             "hidetext": true
  76.                                             }) 
  77.                                     }}</span>
  78.                                 </div>
  79.                                 <br /><br /><br /><hr /><hr /><br />
  80.                         {% endfor %}
  81.                     </div>
  82.                     <div{{ showContainerObject }}>
  83.                          <div style="width: 100%;padding-left:37px;margin-top:30px;">
  84.                             <p class="hl">Bitte Gallery-Objekt zuweisen:</p>
  85.                         </div>
  86.                         <div class="dragdrop">
  87.                             <span class="parentbox">
  88.                                 {{ pimcore_relation("objectGallery",  
  89.                                     {"types": ["object"],
  90.                                     "subtypes": {
  91.                                         "object": ["object"]
  92.                                     },
  93.                                     "classes": ["gallery"],
  94.                                     "width": "750px"
  95.                                     })
  96.                                 }}
  97.                             </span>
  98.                         </div>
  99.                         <br /><br /><br /><br />
  100.                         
  101.                     </div>
  102.                 </section>
  103.             {% endif %}
  104.     </div>
  105.     {{ include('includes/backend-fuss.html.twig') }}
  106. {% else %}
  107.     {% set abstand_top_class = (checkMultiselect(pimcore_multiselect("artikel"),'abstand-top') == true)? ' abstand-top' : '' %}
  108.     {% set abstand_bottom_class = (checkMultiselect(pimcore_multiselect("artikel"),'abstand-bottom') == true)? ' abstand-bottom' : '' %}
  109.     {% set abstandClasses = abstand_top_class ~ abstand_bottom_class %}
  110.     {% set sliderId = document.getId() %}
  111.     {% set showSnippetArray = [] %}
  112.    {% for i in pimcore_block('sliderblock').iterator %}
  113.         {% set imageId = pimcore_image("sliderBild").getId() %}
  114.         {% set asset = pimcore_asset(imageId) %}
  115.         {% if asset is not empty %}
  116.             {% set image_path = pimcore_image("sliderBild").getSrc() %}
  117.             {% set title = asset.getMetadata("title") %}
  118.                 {% set showSnippetArray = showSnippetArray|merge({ (loop.index0) :{"path": image_path,"title": title} }) %}
  119.         {% endif %}
  120.    {% endfor %}
  121.     {% if pimcore_select("gallerySelect").getData() == 'object' %}
  122.                        {% set showGallaryArray =  galleryArray %}
  123.                     {% elseif pimcore_select("gallerySelect").getData() == 'snippet'%}
  124.                         {% set showGallaryArray =  showSnippetArray %}
  125.                     {% else %}
  126.                         {% set showGallaryArray =  showSnippetArray %}
  127.                     {% endif %}
  128.     <div class="{{ abstandClasses }}">
  129.         {% set areaBlock = pimcore_areablock("AreablockTop") %}
  130.             {% if areaBlock.isEmpty() == false %}
  131.                 <div class="constrainer-maxsize edgepadding">
  132.                     {{ areaBlock | raw }}
  133.                 </div> 
  134.             {% endif %}
  135.         {% set lang = app.request.getLocale() %}  
  136.         <div class="constrainer-maxsize">
  137.             <div class="owl-carousel owl-theme owl-nav-spacer" data-slider="{{ sliderId }}">
  138.                 {% for item in showGallaryArray %}
  139.                      <a class="chocolat-image" href="{{ item.path }}" title="{{ item.title }}" style="display:block;">
  140.                             {{ imageResponsive({"src": item.path,
  141.                                 "ausgabeformat": "img",
  142.                                 "endtag": true,
  143.                                 "language": lang }) | raw }}
  144.                      </a>
  145.                 {% endfor %}
  146.             </div>
  147.         </div>
  148.     </div>      
  149. <script type="text/javascript">
  150.     (function () {
  151.         var moduleName = 'gallery_slider_{{ sliderId }}_module'; // naming convention XXX_module
  152.         if (typeof selt === 'undefined') {
  153.             selt = {
  154.                 modules: {}
  155.             };
  156.         } else if (!selt.modules) {
  157.             selt.modules = {};
  158.         }
  159.         selt.modules[moduleName] = {
  160.             name: moduleName,
  161.             init: function () {
  162.                 init();
  163.             }
  164.         };
  165.         function init() {
  166.             galleryEl = $('[data-slider="{{ sliderId }}"]');
  167.             galleryEl.owlCarousel({
  168.                 loop: false,
  169.                 items: 1,
  170.                 margin: 0,
  171.                 nav: true,
  172.                 navText: [
  173.                     '<svg viewBox="0 0 27.2 105.2" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg"><polygon class="st0" points="25.4,105.2 0,52 25.4,0 27.2,0.9 2.2,52 27.2,104.3"/></svg>',
  174.                     '<svg viewBox="0 0 27.2 105.2" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg"><polygon class="st0" points="25.4,105.2 0,52 25.4,0 27.2,0.9 2.2,52 27.2,104.3"/></svg>'
  175.                 ],
  176.                 responsive: {
  177.                     800: {
  178.                         items: 3,
  179.                     },
  180.                     700: {
  181.                         items: 2,
  182.                     }
  183.                 }
  184.             });
  185.             galleryEl.Chocolat({
  186.                 loop: true
  187.             });
  188.             galleryEl.find('.responsiveImg').pictofit('resize');
  189.             galleryEl.find('.owl-item > *').matchHeight({
  190.                 byRow: false
  191.             });
  192.         }
  193.     }());//EOS
  194. </script>
  195. {% endif %}