I would like to divide a list of items in two column with Twig.
For the moment my list get 10 items so I can put 5 items in each column with batch(5)
. But if I add items in the future in my back office after 10 items a new column will be create and I don't want a new column.
How to get the length of my list and split the items automatically in two columns ?
{% for row in bloc.team_references_repeater|batch(5) %}
<div class="col-tn-12 col-xs-6 col-md-3">
<ul class="team__references-list">
{% for item in row %}
<li class="team__references-item"><a href="{{ item.team_references_link }}" class="team__references-link">{{ item.team_references_name }}</a></li>
{% endfor %}
</ul>
</div>
{% endfor %}