templates/modules/gallery-display.html.twig line 1

Open in your IDE?
  1. {% extends "modules/tmpl/default.html.twig" %}
  2. {% block module_content %}
  3. {% set placed = 0 %}
  4. {% if module.data %}
  5. <div class="row mb-3">
  6. {% for i in 0..module.data|length-1 %}
  7. {#
  8. {% for mgroup in content.getMediaGroups() %}
  9.     <h4 class="gallery-title">{{ mgroup.getTitle() }}</h4>
  10.     <h4 class="gallery-description">{{ mgroup.getDescription() }}</h4>
  11.     <div class="row">
  12.     {% for mitem in mgroup.getMediaGroupItems() %}
  13.         {% if mitem.getMedia() is not empty %}
  14.             {% set media = mitem.getMedia() %}
  15.             <div class="col-md-3">
  16.                 <a href="{{media.getURL()}}"><img src="{{media.getURL()}}"></a>
  17.                 <div class="gallery-item-description">{{media.getDescription()}}</div>
  18.             </div>
  19.         {% endif %}
  20.     {% endfor %}
  21.     </div>
  22. {% endfor %}
  23. #}
  24.     {% set row = module.data[i] %}
  25.     {% if placed != 0 and placed is divisible by(module.columns) %}
  26.         </div>
  27.         <div class="row mb-3">
  28.     {% endif %}
  29.     <div class="col-md-{{ 12 / module.columns }}" style="text-align: center;" >
  30.         {% if module.show_titles is defined and module.show_titles == "yes" %}
  31.         <div class="ct14">
  32.             <a style="font-size:16.8px!important;" href="{% if module.links[i] is defined %}{{ module.links[i] }}{% else %}{{ row.getURL() }}{% endif %}">
  33.                 {{ row.getTitle() }}
  34.             </a>
  35.         </div>
  36.         {% endif %}
  37.         <a href="{% if module.links[i] is defined %}{{ module.links[i] }}{% else %}{{ row.getURL() }}{% endif %}" aria-label="{{ row.getTitle() }}">
  38.             <div class="CropDiv">
  39.                 <img
  40.                     src="{{ attribute(row, 'getFeaturedImageURL') is defined ? row.getFeaturedImageURL() : row.getURL() }}"
  41.                     alt="{{ row.getTitle() }}"
  42.                     loading='lazy'
  43.                 />
  44.             </div>
  45.         </a>
  46.         {% if module.show_description is not defined or (module.show_description is defined and module.show_description == "yes") %}
  47.         <div class="text-center">
  48.             {% if module.links[i] is defined %}
  49.                 <a href="{{ module.links[i] }}" aria-label="{{ row.getTitle() }}">
  50.             {% endif %}
  51.             {% if module.mitems %}
  52.                 <em>{{ attribute(row, 'getDescription') is defined ? module.mitems[i].getDescription() : '' }}</em>
  53.             {% else %}
  54.                 <em>{{ attribute(row, 'getDescription') is defined ? row.getDescription() : '' }}</em>
  55.             {% endif %}
  56.             {% if module.links[i] is defined %}
  57.                 </a>
  58.             {% endif %}
  59.         </div>
  60.         {% endif %}
  61.     </div>
  62.     {% set placed = placed + 1 %}
  63. {% endfor %}
  64. </div>
  65. {% endif %}
  66. {% endblock %}
  67. {#
  68. {% set placed = 0 %}
  69. <div class="row mb-3">
  70. {% for row in module.data %}
  71.     {% if placed != 0 and placed is divisible by(module.columns) %}
  72.         </div>
  73.         <div class="row mb-3">
  74.     {% endif %}
  75.     <div class="col-md-{{ 12 / module.columns }}">
  76.         <a href="{{ row.getURL() }}" target="_blank">
  77.             <img
  78.                 src="{{ attribute(row, 'getFeaturedImageURL') is defined ? row.getFeaturedImageURL() : row.getURL() }}"
  79.                 alt="{{ row.getTitle() }}"
  80.             />
  81.         </a>
  82.         {% if module.show_description is not defined or (module.show_description is defined and module.show_description == "yes") %}
  83.         <div class="text-center">
  84.             <em>{{ attribute(row, 'getDescription') is defined ? row.getDescription() : '' }}</em>
  85.         </div>
  86.         {% endif %}
  87.     </div>
  88.     {% set placed = placed + 1 %}
  89. {% endfor %}
  90. </div>
  91. #}