On Monday, June 15, 2020 at 5:36:00 PM UTC-7, Ankit Mittal wrote:
>
> I have been trying to get a variable set such that it has the title of
> current toddler without spaces. I tried following but it did not work...
>
> \define testCreate()
> <$set name=test filter=""" <<currentTiddler>> +[join[_]] """>
> <<test>>
> </$set>
>
> \end
>
> <<testCreate>>
>
> If title of current tiddler is "Hello There Abbey", I was hoping above
> macro would result in Hello_There_Abbey but it did not.
>
Try this:
<$set name="test" filter="[<currentTiddler>split[ ]join[_]]">
<<test>>
</$set>
You can also achieve the same results with the <$vars> widget, using an
"inline filter", like this:
<$vars test={{{ [<currentTiddler>split[ ]join[_]] }}}>
<<test>>
</$vars>
and, if you just want to *display* the value, you don't even need the
$vars. Just write:
<$text text={{{ [<currentTiddler>split[ ]join[_]] }}}/>
enjoy,
-e
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/31bed395-429b-45ef-b844-abbc5f4e0f81o%40googlegroups.com.