Staff Order – Hierarchical Sorting

WordPress Plugin Staff List – Staff Order – Hierarchical Sort

Most of the time, your staff list page will display names as First-Last but sorted by Last-First. The can be easily achieved by choosing field type – Name Multipart to hold the data and Post Title or Sort Text a sort option. In such case the field selected as sort option will have names entered in the Last-First format.
This way of sorting may not be suitable for all scenarios. Sometimes you may want to use job title or any other criteria to place some of the staff members on the top. Manual sort can work with few records but for larger datasets there is a better option – hierarchical sorting.

Hierarchical sorting

Sort Text field can be used for hierarchical sorting (multiple-key sorting). It allows you to sort data according to multiple sorting criteria in a hierarchical manner.
For example, to display a manager as the first item on the staff members page, enter:
010 Last First name
For the rest of the team:
020 Last Name First Name
You can modify an expand this concept to fit your requirements.

Sorting on numeric values

Numbers are stored as strings and sorted alphabetically. In other words, numbers will be sorted based on the individual digits that make up the value, instead of on the numeric value. For example, the value 11 appears before 2, and the value 12 appears before 3.
To make the sorting work with numbers involves “padding” values that contain fewer digits with leading zeroes. For example, you change the values 1, 2, and 3 to 0100, 0120, and 0130.