Hi @TartakOO there is some discussion of that approach on GitHub. In principle I like the idea of a more idiomatic way of handling if/then/else but I have reservations about implementing it as a widget. Our general policy is that we aim for widgets to be small, composable primitives, and work in the wikitext layer to optimise for expressiveness and brevity.
Implementing if/then/else at the wikitext layer might best be done with a different syntax for block mode vs. inline. For block mode we might use the backslash syntax that we use for pragmas:
\if [<currentTiddler>match[HelloThere]]
Displayed if the filter returns at least one result
\else
Displayed if the filter returns no results
\endif
I don’t have a good suggestion for inline mode. For the sake of argument, we could have (if( FILTER ) then ( TEXT ) else ( TEXT ))
. It’s obviously unwieldy and alien but it shows the required approach: to choose unique character sequences to start, delimit and end the filter and the clauses:
My name is (if( [<currentTiddler>match[HelloThere]] ) then ( TiddlyWiki ) else ( anonymous ))>.