templates/elements/media-group-v2.html.twig line 53

Open in your IDE?
  1. {# Media Group Element #}
  2. {% spaceless %}
  3. {% set items = module.items %}
  4. {% if module.class == "gallery" %}
  5.     {% set placed = 0 %}
  6.     {#{% set items = module.data.getMediaGroupItems() %}#}
  7.     <div class="row mb-3">
  8.         {% if items is not empty %}
  9.             {% for i in 0..items|length-1 %}
  10.                 {% set item = items[i] %}
  11.                 {% if item.isActive() and (module.data.getDisplayLimit() <= 0 or placed < module.data.getDisplayLimit()) %}
  12.                     {% if placed != 0 and placed is divisible by(module.columns) %}
  13.                         </div>
  14.                         <div class="row mb-3">
  15.                     {% endif %}
  16.                     <div class="col-md-{{ 12 / module.columns }}" style="text-align: center;" >
  17.                        {% set media = item.getMedia() %}
  18.                         <div class="media-block">
  19.                         {% include "elements/media-items.html.twig" %}
  20.                         </div>
  21.                     </div>
  22.                     {% set placed = placed + 1 %}
  23.                 {% endif %}
  24.             {% endfor %}
  25.         {% endif %}
  26.     </div>
  27. {% else %}
  28.     {% set placed = 0 %}
  29.     <div class="media-group">
  30.         <div {{ get_attributes(module.data.getAttributes()) }}>
  31.         {% set uri = app.request.getRequestUri() %}
  32.         {% set current_route = app.request.attributes.get('_route') %}
  33.         
  34.         {#
  35.         Base URL: {{ app.request.getSchemeAndHttpHost() }}
  36.         URI: {{ uri }}
  37.         Current Route: {{ current_route }}
  38.         #}
  39.         {# Pinned sidebar ad #}
  40.         {% if module.position == "ad-sidebar" %}
  41.             {{ render(controller(
  42.                 'App\\Controller\\Master\\ContentController::pinnedSidebarAd',
  43.                 {
  44.                     'base_url': app.request.getSchemeAndHttpHost(),
  45.                     'uri': uri,
  46.                     'current_route': current_route
  47.                 }
  48.                 ))
  49.             }}
  50.         {% endif %}
  51.         
  52.         {% for item in items %}
  53.             {% if item.isActive() and (module.data.getDisplayLimit() <= 0 or placed < module.data.getDisplayLimit()) %}
  54.                 {% set media = item.getMedia() %}
  55.                 <div class="media-block">
  56.                 {% include "elements/media-items.html.twig" %}
  57.                 </div>
  58.                 {% set placed = placed + 1 %}
  59.             {% endif %}
  60.         {% endfor %}
  61.         {% if module.show_buttons is defined and module.show_buttons == "yes" %}
  62.             <nav class="" style="text-align: center;">
  63.             {% set x = 0 %}
  64.             {% for item in items %}
  65.                 {% if item.isActive() %}
  66.                     <i class="fa fa-circle rotation-nav {% if x == 0 %}rotation-nav-active{% endif %}" data-slide="{{x}}" style="padding:5px;"></i>
  67.                     {% set x = x + 1 %}
  68.                 {% endif %}
  69.             {% endfor %}
  70.             </nav>
  71.         {% endif %}
  72.         </div>
  73.     </div>
  74. {% endif %}
  75. {% endspaceless %}