You are here

bs-columns.html.twig in Bootstrap Kit 8.3

Same filename and directory in other branches
  1. 8.4 templates/bs-columns.html.twig
{% if content %}

{% set columns = 0 %}
{% for region in layout.getRegionNames if content[region] %}
  {% set columns = columns + 1 %}
{% endfor %}

{% if columns > 0 %}
<div {{ attributes.addClass('row') }}>
  {% for region in layout.getRegionNames if content[region] %}
  <div class="col-md-{{ 12 / columns }}">
    {{ content[region] }}
  </div>
  {% endfor %}
</div>
{% endif %}

{% endif %}

File

templates/bs-columns.html.twig
View source
  1. {% if content %}
  2. {% set columns = 0 %}
  3. {% for region in layout.getRegionNames if content[region] %}
  4. {% set columns = columns + 1 %}
  5. {% endfor %}
  6. {% if columns > 0 %}
  7. <div {{ attributes.addClass('row') }}>
  8. {% for region in layout.getRegionNames if content[region] %}
  9. <div class="col-md-{{ 12 / columns }}">
  10. {{ content[region] }}
  11. </div>
  12. {% endfor %}
  13. </div>
  14. {% endif %}
  15. {% endif %}