Hi everyone. I would massively appreciate some help on this problem.
I have a function that returns a list of tiddlers, that I will use within a list widget in a view template. It is something like this:
[function[my_tiddler_list]]
Now I want to do a bit more filtering, but only under certain conditions. Specifically if the current tiddler is not called Stuff
I want the filter to look like this:
[function[my_tiddler_list]] +[tag<currentTiddler>]
Otherwise if the current tiddler is called Stuff
I want the filter to look like this:
[function[my_tiddler_list]] -[tag[Activity]tagging[]]
I’m struggling to find a good pattern for applying these extra filter runs only under certain conditions.
The below is my best attempt. It works for the first condition, but not the second.
\function conditional_run()
[<currentTiddler>!match[Stuff]] :then[tag<currentTiddler>] :else[remove<all_tagged>]
\end
\function all_tagged()
[tag[Activity]tagging[]]
\end
<$list filter="[function[my_tiddler_list] +[function[conditional_run]]" />
Can anyone help?