I want to create a package for each element in the packages array. And if a package belongs to a type, to create a different row.
Let's say i have packages: A,B,C,D,A2,B3,C6,D8. A and A2 will be a row; B and B3 will be a different row and so on.
Tried to make a for loop for each package in packages and loop it if index0 % 2 ==0;
code looks like this
<div class="dashboard">
<div class="row">
<div class="container margin-bottom-60">
<h2>boom</h2>
<h4>lorem</h4>
<br>
{% for package in packages %}
{% if loop.index0 % 2 == 0 %}
<div class="col-md-4">
<div class="packages-backend-elment">
<div class="col-md-12">
<h3>{{ package.title }}</h3>
<span>{{ package.shortTitle }}</span>
<div class="price">
{{ package.price }}
</div>
<div class="description">
{{ package.shortDescription | raw }}
</div>
<div class="buttons">
<a href="#">
<button type="button" class="btn-6 btn ink-reaction btn-flat dropdown-toggle paymentRequestBtn" data-urlaction="/employee/payment-requests/{{ package.id }}"></button>
</a>
<a href="#">
<button type="button" class="btn-6 btn ink-reaction btn-flat dropdown-toggle show-packages-details"></button>
</a>
</div>
</div>
</div>
</div>
{% endif %}
{% endfor %}
</div>
</div>
</div>