# Multi level sort

**URL:** <https://zola.discourse.group/t/multi-level-sort/2826>\
**Category:** Feature requests\
**Created:** [August 9, 2025, 11:52pm UTC](https://zola.discourse.group/t/multi-level-sort/2826 "2025-08-09T23:52:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pedropontesgarcia](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/pedropontesgarcia/32/1513_2.png) [@pedropontesgarcia](https://zola.discourse.group/u/pedropontesgarcia)\
**Post date:** [August 9, 2025, 11:52pm UTC](https://zola.discourse.group/t/multi-level-sort/2826/1 "2025-08-09T23:52:40Z")

</div>

I wanted to propose a way to sort by several variables, where further variables are used to tie-break. The use case for this is simple: I have three tiers of projects – stellar, cool, and meh – each of which corresponding to a weight value, and in each category, I’d like the projects to sort themselves by date. Doing this manually is tedious – if I’m using different weights for each post, then every time I add a new ‘cool’ project I have to change the weight values of all the ‘cool’ and ‘meh’ projects.

API-wise, I envision this as the `sort_by` variable taking in either a single string value as usual, or optionally an array like `[“weight”, “date”]` where each variable corresponds to one level of the nested sort.

Implementation-wise, I’m new to the Zola codebase but upon a quick look it seems like [here](https://github.com/Keats/tera/blob/af0b32f8cec3d2863fbb91983c3599f7923af24e/src/filter_utils.rs) would be a reasonable place to start?

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [August 12, 2025, 10:29am UTC](https://zola.discourse.group/t/multi-level-sort/2826/2 "2025-08-12T10:29:49Z")

</div>

When you say sort, it’s only the filter or the pages sort as well?

---

<div class="post-metadata">

**Author:** ![pedropontesgarcia](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/pedropontesgarcia/32/1513_2.png) [@pedropontesgarcia](https://zola.discourse.group/u/pedropontesgarcia)\
**Post date:** [August 12, 2025, 12:27pm UTC](https://zola.discourse.group/t/multi-level-sort/2826/3 "2025-08-12T12:27:54Z")

</div>

Pages sort too! I feel like multi level sort is a reasonable sorting method to provide in any case.
