As discussed in this thread, here is a piece of TW syntax lore that may not be very obvious.
The $macrocall
documentation tells us that
Macro parameters are specified as widget attributes, thus allowing indirection via
{{title!!field}}
,<<macroname>>
or{{{filter}}}
However, this does not work directly when the macro call is used in the action attribute of various widgets. Instead, you have to wrap it in triple double quotes, like so:
\define clickactions(text)
<$action-sendmessage $message="tm-notify" $param=<<__text__>> />
\end
<$let variable="SampleNotification">
<$button actions="""<$macrocall $name="clickactions" text=<<variable>> />""" >
Click Me
</$button>
</$let>
@EricShulman explained it in the context of the $button
widget like this:
[With triple double quotes, the] macrocall is defined as literal text that is only invoked (and wikified) when the
$button
widget is actually clicked. Thus, a true macro call is occurring.
Without the triple quotes, the macrocall is simply replaced by the text of the macro when the $button
widget is rendered, so that any macro parameters have no meaning.
Have a nice day
Yaisog