Lava Filters - SortNatural

Category:Arrays

Description:Fluid only: Sorts a primitive array, in case-insensitive order. To sort by the properties of an array, use OrderBy.
Input: "Fruits": [ "Banana", "orange", "apple" ]
Lava: {% assign fruitsSorted = Fruits | SortNatural %}
    {% for fruit in fruitsSorted %}
  • {{ fruit }}
  • {% endfor %}
Output:
  • Apple
  • banana
  • orange