sort_by_path

Sorts an array by a path.

Example

1
{% assign sortedCollection = collection | sort_by_path: 'path1', 'path2' %}

Input

Type Parameter Description Required
array array The array to sort. Comes before the | sign. Required
string path1 The path to sort by  
string path2 Path path for secondary sort, defaults to ‘’.  

Output

Type Description
array The sorted array