Background
Following discussion by @saqimtiaz here and @Yaisog here
@Yaisog created a PR and developed the new :then
filter run prefix. A demo is available for test. See
- The Idea: [IDEA] Add a
:then
filter run prefix · Issue #7385 · Jermolene/TiddlyWiki5 (github.com) - The PR under review: Add a
:then
filter run prefix by yaisog · Pull Request #7392 · Jermolene/TiddlyWiki5 (github.com) - The Demo: tiddlywiki5-k7yd2tg3y-jermolene.vercel.app
Use cases
This filter run prefix is very useful, as it is one of the missing filter prefix in TiddlyWiki filter language. In general you can use it like
<$list filter="[condition] :then[true-part] :else[false-part]">
For example see:
<$edit-text field="search" placeholder="Search title"/>
<$let searchTerm={{!!search}}>
<$list filter="[<searchTerm>minlength[3]] :then[!is[system]search:title<searchTerm>]" template="$:/core/ui/ListItemTemplate"/>
</$let>
You can contribute: I am sure you can give a try and add your own use cases/examples here.