widget complex attribute

41 views
Skip to first unread message

Sebastian Ovide

unread,
Jul 18, 2019, 4:20:35 PM7/18/19
to TiddlyWikiDev
Hello All

I'm building by first widget. It accepts an attribute and it works. Now I'm trying to create that attribute from a macro but the value from the macro, even if displayed correctly, it is not converted into text inside the attribute. 

/define macro_good()
1,2,3,4,5,6
/
end
/define macro_bad()
1,2,3,{{blabla!!blabla}},5,6
/end

<<macro_good>>
<<macro_bad>>

<$myWidget att=<<macro_good>>>
<$myWidget att=<<macro_bad>>>



<<macro_good>> and <<macro_bad>> display exactly the same result on the tiddler but the attribute that <$myWidget att=<<macro_bad>>> gets is the string "1,2,3,{{blabla!!blabla}},5,6" instead of "1,2,3,4,5,6"

any ideas ?

thanks
 

BJ

unread,
Jul 19, 2019, 11:51:04 AM7/19/19
to TiddlyWikiDev
this is the normal behavior of macros - they act differently when used as parameter values to widget then when used alone.

When used alone the return values are 'wikified' but not when used as parameter values

hope this helps

BJ

Sebastian Ovide

unread,
Jul 19, 2019, 3:00:55 PM7/19/19
to TiddlyWikiDev
thanks BJ

I've just discovered the widget $wikify. With it the working code looks li this

<$wikify name="good_atts" test="1,2,3,{{blabla!!blabla}},5,6">
  <$myWidget att=<< good_atts>>/>
</$wikify>
Reply all
Reply to author
Forward
0 new messages