You are here

bs-tabs.html.twig in Bootstrap Kit 8.4

Same filename and directory in other branches
  1. 8.3 templates/bs-tabs.html.twig
{% if content %}
{% set id = random() %}
<div {{ attributes }}>

<!-- Nav tabs -->
<nav class="nav nav-tabs mb-3">
  {% for region in layout.getRegionNames if content[region] %}
  <a class="nav-item nav-link {{ loop.first ? 'active' }}" data-toggle="tab" href="#tab-{{ id }}-{{ region }}">
    {{ content[region]['#label'] }}
  </a>
  {% endfor %}
</nav>

<!-- Tab panes -->
<div class="tab-content">
  {% for region in layout.getRegionNames if content[region] %}
  <div class="tab-pane {{ loop.first ? 'active' }}" id="tab-{{ id }}-{{ region }}">
    {{ content[region] }}
  </div>
  {% endfor %}
</div>

</div>
{% endif %}

File

templates/bs-tabs.html.twig
View source
  1. {% if content %}
  2. {% set id = random() %}
  3. <div {{ attributes }}>
  4. <!-- Nav tabs -->
  5. <nav class="nav nav-tabs mb-3">
  6. {% for region in layout.getRegionNames if content[region] %}
  7. <a class="nav-item nav-link {{ loop.first ? 'active' }}" data-toggle="tab" href="#tab-{{ id }}-{{ region }}">
  8. {{ content[region]['#label'] }}
  9. </a>
  10. {% endfor %}
  11. </nav>
  12. <!-- Tab panes -->
  13. <div class="tab-content">
  14. {% for region in layout.getRegionNames if content[region] %}
  15. <div class="tab-pane {{ loop.first ? 'active' }}" id="tab-{{ id }}-{{ region }}">
  16. {{ content[region] }}
  17. </div>
  18. {% endfor %}
  19. </div>
  20. </div>
  21. {% endif %}