templates/partials/archivBlock.html.twig line 1

Open in your IDE?
  1. {% block archivBlock %}
  2. {% set archive_rows = archives|batch(tabs_per_row) %}
  3. {# Initialize the global_index variable #}
  4. {% set global_index = 0 %}
  5. {% set global_index_2 = 0 %}
  6. {% for row in archive_rows %}
  7. <section id="features_r1" class="features" style="padding: 0">
  8. <div class="container" data-aos="fade-up">
  9. <!-- Nav Tabs for Each Row -->
  10. <ul class="nav nav-tabs row gy-4 d-flex" >
  11. {% for archive in row %}
  12. <li class="nav-item col-12 col-sm-6 col-md-3 col-lg-3" style="position: relative; margin-top: -0.5%">
  13. {# Use global_index instead of loop.index for unique IDs #}
  14. <a class="nav-link" id="tab-{{ global_index }}" data-toggle="tab" href="#content-{{ global_index }}" role="tab">
  15. <img class="tile-image" src="{{ archive.img.url }}" tabindex="0" alt="{{ archive.startyear }}-{{ archive.endyear }}">
  16. <h4 style="font-family: 'Rajdhani Bold',serif;">{{ archive.startyear }}<span style="font-family: Rajdhani,sans-serif; font-weight: 100">|</span>{{ archive.endyear }}</h4>
  17. </a>
  18. </li>
  19. {# Increment the global_index for every archive #}
  20. {% set global_index = global_index + 1 %}
  21. {% endfor %}
  22. </ul>
  23. <!-- Tab content for each archive in the row -->
  24. <div class="tab-content">
  25. {% for archive in row %}
  26. <div class="tab-pane fade" id="content-{{ global_index_2 }}" role="tabpanel" aria-labelledby="tab-{{ global_index_2 }}">
  27. <h4 style="font-family: 'Rajdhani Bold',serif; font-size: 120px;">{{ archive.startyear }}<span style="font-family: Rajdhani,sans-serif; font-weight: 100">|</span>{{ archive.endyear }}</h4>
  28. <div style="width: 70%;">{{ archive.textBlock|raw }}</div>
  29. {% for image_row in archive.images|batch(2) %}
  30. <div class="row mt-4" style="width: 100%; margin-left: 0; margin-right: 0; margin-bottom: 5%">
  31. {% for image in image_row %}
  32. {% if loop.index == 1 %}
  33. <div class="col-lg-7 text-center" data-aos="fade-up" style="width: 62%; padding-left: 0; padding-right: 0;">
  34. <img src="{{ image.getUrl }}" alt="" class="img-fluid" style="max-width: 96%; margin-right: 40px">
  35. </div>
  36. {% else %}
  37. <div class="col-lg-5 text-center" data-aos="fade-up" style="width: 38%; padding-left: 0; padding-right: 0;">
  38. <img src="{{ image.getUrl }}" alt="" class="img-fluid-2">
  39. </div>
  40. {% endif %}
  41. {% endfor %}
  42. </div>
  43. {% endfor %}
  44. </div>
  45. {% set global_index_2 = global_index_2 + 1 %}
  46. {% endfor %}
  47. </div>
  48. </div>
  49. </section>
  50. {% endfor %}
  51. {% endblock %}