Skip to content
Log in

sort_natural - Liquid Filter Reference

On this page

Description

Sorts items in an list in case-insensitive order.

Property Value
Return Type list
Category lists

Examples

liquid {{ array | sort_natural | join: ", " }}

Output: air, earth, fire, water

An optional argument specifies which property of the list’s items to use for sorting

```liquid {% assign pages_by_title = pages | sort_natural: “title” %}

{% for page in pages_by_title -%} - {{ page.title }} {% endfor %} ```

Output: - About Us\n- Home\n- Privacy Policy

Was this article helpful?

Was this article helpful?