I have a channel of entries I'd like to loop through by order of importance on a scale of 1-5 with 5 being the most important and appearing first.
I tried to achieve this using a radio button field called importance and if else statements like:
{# List most important entries first #}
{% if entry.importance == "5" %}
<li class="deal">
<div class="brand-image-wrapper">
{% if entry.logo | length %}
{% for asset in entry.logo %}
<img class="grayscale" src="{{ asset.url }}" alt="{{ image.title }}">
{% endfor %}
{% endif %}
</div>
<div class="info">
<h2 class="title">{{ entry.companyName }}</h2>
<p>{{ entry.description }}</p>
</div>
</li>
{% elseif entry.importance == "4" %}
<li class="deal">
<div class="brand-image-wrapper">
{% if entry.logo | length %}
{% for asset in entry.logo %}
<img class="grayscale" src="{{ asset.url }}" alt="{{ image.title }}">
{% endfor %}
{% endif %}
</div>
<div class="info">
<h2 class="title">{{ entry.companyName }}</h2>
<p>{{ entry.description }}</p>
</div>
</li>
etc...
But this isn't very DRY and this lists the entries but they are still ordered by date. Is it possible to use .order with a field to achieve this?