Found an IF-ELSE macro on tw.com

85 views
Skip to first unread message

Mat

unread,
Aug 19, 2015, 2:25:21 PM8/19/15
to TiddlyWiki
I guess this is a Q to @Jeremy but if anyone else can answer, please go ahead :-)

I just discovered an IF-ELSE macro on tw.com. I have considered asking if some kind of if-else operator could be implemented so this might be a welcome discovery - butI can't find any guidance on how to use it? And why isn't it more "public"? I must typically use workarounds involving filtering things, often with only one title involved.

Would be great with some info on how to use it (or hearing why not to use it). Thank you!

<:-)


Eric Shulman

unread,
Aug 19, 2015, 4:20:53 PM8/19/15
to TiddlyWiki
On Wednesday, August 19, 2015 at 11:25:21 AM UTC-7, Mat wrote:
I just discovered an IF-ELSE macro on tw.com. I have considered asking if some kind of if-else operator could be implemented so this might be a welcome discovery - but I can't find any guidance on how to use it? And why isn't it more "public"? I must typically use workarounds involving filtering things, often with only one title involved.

The macro takes three params: "cond", "then", and "else".  If the "cond" is non-blank it returns the "then" value, otherwise it returns the "else" value.

Using Advanced Search to find the instances where ".if" is used, it appears that the macro is something Jeremy created specifically for formatting documentation within tw.com, and I don't think it is intended for general use.

-e

Reply all
Reply to author
Forward
0 new messages