Advanced sorting by metadata values ordered with custom 'lookup list' idea (a non alphabetical, non numerical, arbitrary list of labels)
Parking the idea posted by @Chapien here in discussions.
[...] is it possible to manually sort by metadata, in an explicit order? I have a reading list, with a property called 'status' that can have three values: reading, unread, complete. I want to manually sort it so that those with the reading status are on top, then unread, then complete. However, I can only see how to sort with implicit (ie, by alphabetical order) instructions. Is there any way I can list a pre-defined order of priority? Ie hard define the order as "reading, unread, complete" based on the metadata value.
Oh, then I'm guessing it's not yet possible. Glad it was a good idea though!! Thank you.
@Chapien yup, not supported for now, as stated below your original question in discussions.
Yet, after sleeping on the idea it turned out that a simple implementation is at hand, a low hanging fruit. I should have time to do it in two weeks from now, and the concept boils down to grouping items by the value of specified metadata (for now grouping can be driven by presence of specified metadata with any value).
---
sorting-spec: |
with-metadata: status value-matching(reading)
> modified
with-metadata: status value-matching(unread)
> created
with-metadata: status value-matching(complete)
< a-z
---
This looks great, looking forward to the update.
I came across this same sort need, but I haven't been able to get the syntax to work. Using the OP's objective, would you be willing to provide an example of what that final sortspec would look like?
Hi @jodyblau,
the feature has not been released yet, a work in progress. The relevant PR is #196. Need to implement handling of additional scenarios and create unit tests to cover the new feature.