I'm looking for shorter way of doing this:
dog dog dog
––––––––––––––––––––––––––
cat cat cat
––––––––––––––––––––––––––
hamster hamster hamster
Currently, I have to run 3 independent loops to group pet types together, and insert a line rule between them.
How can I group pet types together and separate using a line rule?
<div class="row">
{% for pet in entries %}
{% if pet.kind == 'dog' %}
{% include '_partials/animalOrgChart' with {
title: pet.title,
subTitle: pet.jobTitle,
img: pet.headshot|length ? pet.headshot[0],
url: pet.url,
portrait: true
} %}
{% endif %}
{% endfor %}
<hr class="line" />
</div>
<div class="row">
{% for pet in entries %}
{% if pet.kind == 'cat' %}
{% include '_partials/animalOrgChart' with {
title: pet.title,
subTitle: pet.jobTitle,
img: pet.headshot|length ? pet.headshot[0],
url: pet.url,
portrait: true
} %}
{% endif %}
{% endfor %}
<hr class="line" />
</div>
<div class="row">
{% for pet in entries %}
{% if pet.kind == 'hamster' %}
{% include '_partials/animalOrgChart' with {
title: pet.title,
subTitle: pet.jobTitle,
img: pet.headshot|length ? pet.headshot[0],
url: pet.url,
portrait: true
} %}
{% endif %}
{% endfor %}
<hr class="line" />
</div>