New topic Closed topic
avatar image
1
Liquid for...endfor. Sorting in related model
By Created , last editted

Hi, I discovered you can do a nested for...endfor with Liquid based on a related model, as in:

{% for order in col_orders %}
    {{order.order_date | date: "%d-%m-%Y"}}
    {% for article in order.articles %}
        {{article.articletype.article}}: {{article.amount_ordered}}
    {% endfor %} {% endfor %} 

Cool! But is there any way to sort the articles (for example on their article code)?

Hans


Hi, I discovered you can do a nested for...endfor with Liquid based on a related model, as in:

{% for order in col_orders %}
    {{order.order_date | date: "%d-%m-%Y"}}
    {% for article in order.articles %}
        {{article.articletype.article}}: {{article.amount_ordered}}
    {% endfor %} {% endfor %} 

Cool! But is there any way to sort the articles (for example on their article code)?

Hans

Answers
Sort by:

This topic is closed.