Lava Example - 61 | Rock Community

Lava Example - 39


Prompt

We need to know what allergies Ted's children have.

Your template already has Ted stored in {{ Person }}, so get his children's allergies. But of course we want to make sure the allergies are listed alphabetically!

(Hint: remember that person allergies are stored in an attribute with a key Allergy).

Initial Code
{{ Person }}
Solution Lava
{% assign children = Person | Children | SortByAttribute:'Allergy' %}
<ul>
    {% for child in children %}
        <li>
            {{ child.FullName }}:
            {{ child | Attribute:'Allergy' }}
        </li>
    {% endfor %}
</ul>