As a simple example of overriding a widget in the new //Grok TiddlyWiki//, I’m trying to override the $link
widget to change the target. This works great until I try to use $params
, $names
, and $values
to pass through all the possible parameters to $link
that I don’t want to change. Here’s my example:
\widget $link()
<$parameters $params="params-var">
<$genesis
$type="$link"
$remappable="no"
$names="[<params-var>jsonindexes[]]"
$values="[<params-var>jsonindexes[]] :map[<params-var>jsonget<currentTiddler>]"
to="New Target"
>
<$slot $name="ts-raw">
</$genesis>
</$parameters>
\end
* <$link to="Links" tooltip="xyz">Ttip Link</$link> to a tiddler
* [[Links]] are a fundamental part of a TiddlyWiki.
What happens is that the to
parameter to $genesis
I’ve explicitly specified is not honoured – the to
parameter on my original $link
widget is used instead, defeating the purpose of overriding the widget (in this example, both links link to Links
instead of to New Target
; if I delete the $names
and $values
parameters, the targets change as expected).
I would assume that overriding the version in $names
and $values
was something that was just not supported, except the widget documentation on tiddlywiki.com carefully notes that this is supported:
Note that attributes explicitly specified take precedence over attributes with the same name specified in the
$names
filter.
Am I missing something, or is this just behaving wrong?