Customer Sort Order in Filter

Good morning, I am running a filter expression for a list of tasks. Now I want to use a sort making sure that the order is Future, To Do, Working, Done. Anyone an idea how to make this custom sort order?

I think you’ll have to give us a little more information. Where is that status (Future, Done, etc.) stored? Is it a tag on the tiddler? A dedicated field? Something else? Also do you already have that sort order defined somewhere like a list field, or would that be part of the solution you’re looking for?

Dear Scott, thank you for your reply. Each task tiddler has a field status. Using a custom EditTemplate I fill it with the values: Future, Next, To Do, Done, Archived. These values are listed in a tiddler so that I can change it over time if needed. The list of values is in the text field of a configuration tiddler where each line sontains a value.

Unless I misunderstand, you can probably do something like

<$list filter='
[[...myfilter...]status[Future]]
[[...myfilter...]status[Next]]
[[...myfilter...]status[To Do]]
.......etc......
'>

This assumes that your tasks do not have multiple statuses. The “myfilter” bit is whatever other filtering criteria you might have. I guess that bit could be externalized into some variable if the full filter expression is too cluttery.

2 Likes

Assuming you have a config tiddler like this:

$:/config/TaskStatus

Future
Next
[[To Do]]
Done
Archived

With task tiddlers tagged with “Task”,

You can try something like this for a grouped set of task lists:

<dl>
<$list filter="[{$:/config/TaskStatus}enlist-input[]]">
<dt>{{!!title}}</dt>
<$list filter="[all[tiddlers]tag[Task]status<currentTiddler>]">
<dd><$link /></dd>
</$list>
</$list>
</dl>

or if you want a single list:

<ul>
<$list variable=Status filter="[{$:/config/TaskStatus}enlist-input[]]">
<$list filter="[all[tiddlers]tag[Task]status<Status>]">
<li><$link /> <em><<Status>></em></li>
</$list>
</$list>
</ul>

You should be able to get lists like these:

colored boxes not included

3 Likes

Thank you all very much for your help. Thanks to your input I was able to fix it. I attached the sample tiddler with the planning board where i use this to organize my tasks.Task Planning Board 3.json (2.5 KB)