Hello! I’m in need of a little bit of help.
I would like to open an external url and perform an action (add a tag to current tiddler) on a single click.
I started with a button and have come to this:
<$fieldmangler>
<$button message="tm-add-tag" param="myTag">
Add myTag
</$button>
</$fieldmangler>
This works, that is, it adds myTag to current tiddler. Why <$action-setfield $field="tags" $value={{{ [<currentTiddler>tags[]append[myTag]] }}}/>
inside the button doesn’t work if the tiddler already has some other tags bugs me, but that’s a secondary question.
Now how do I get the button to also open an external url when clicked? The to
parameter of button widget works for tiddlers only, using to="https://www.example.com"
makes it open a tiddler https://www.example.com
.
I tried wrapping contents of button or the whole button widget in <a>
. In the second case i see the link url pop-up when hovering over the button and I can middle-click it to open in a new tab, but a left click triggers only the button (and its action), doesn’t open the link.