You are here

bs-tabs.html.twig in Bootstrap Kit 8.3

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

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

<!-- 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. <ul class="nav nav-tabs">
  6. {% for region in layout.getRegionNames if content[region] %}
  7. <li class="{{ loop.first ? 'active' }}">
  8. <a data-toggle="tab" href="#tab-{{ id }}-{{ region }}">
  9. {{ content[region]['#label'] }}
  10. </a>
  11. </li>
  12. {% endfor %}
  13. </ul>
  14. <!-- Tab panes -->
  15. <div class="tab-content">
  16. {% for region in layout.getRegionNames if content[region] %}
  17. <div class="tab-pane {{ loop.first ? 'active' }}" id="tab-{{ id }}-{{ region }}">
  18. {{ content[region] }}
  19. </div>
  20. {% endfor %}
  21. </div>
  22. </div>
  23. {% endif %}