$set possible bug

18 views
Skip to first unread message

Samir S.

unread,
Sep 28, 2022, 10:59:41 AM9/28/22
to TiddlyWiki
Greetings,

I may have discovered a bug related to the $set widget in tiddlywiki 5.2.2

The following code outputs a correct result but the syntax is incorrect (missing > on the $set statement).

<$set name="thisColor" value=<$transclude tiddler=stateColor index={{!!Phase}}>
<$text text=<<thisColor>> />
</$set>

the current tiddler has field Phase set to "étude" (index from the data tiddler)

The stateColor is a data tiddler with properties like
étude: "#FF0000"
révision: "#00FF00"
rattrapage: "#FFC700"

What do you think ?

Jeremy Ruston

unread,
Oct 2, 2022, 2:05:53 PM10/2/22
to TiddlyWiki
Hi Samir

The syntax "value=<$transclude tiddler=stateColor index={{!!Phase}}>" is incorrect. It is not possible to use widgets as the value of attributes of other widgets.

Try this using this line instead:

<$set name="thisColor" value={{{ [[stateColor]getindex{!!Phase}] }}}>

Best wishes

Jeremy
Reply all
Reply to author
Forward
0 new messages