Set widget (i.e. $set) is a very powerful widget which is not known to many users (or underestimated its power)! In this post some of interesting use cases of set widget are discussed.
Example one
I want to do ThisJob if a condition meets and OtherJob if a condition doesn’t meet
<$set name=Job
filter="check-some-conditions"
value=ThisJob
emptyValue=OtherJob>
<$macrocall $name=<<Job>> />
</$set>
for illustration
\define ThisJob() With Tiddlywiki we are on the moon
\define OtherJob() Oh no, without Tiddlywiki, life is too hard for us!
<$set name=Job
filter="[tag[hirad]count[]compare:integer:gteq[4]]"
value=ThisJob
emptyValue=OtherJob>
<$macrocall $name=<<Job>> />
</$set>
The condition tells [tag[hirad]count[]compare:integer:gteq[4]] if there are 4 or more tiddlers tagged with hirad do ThisJob otherwise do OtherJob.
Instead of macros, one can use transcluded tiddlers, etc.
Note: This is a wiki post, everybody is welcome to edit and add his/her contents directly here