Workaround for LinkWidget tooltip transclusion recursion error

This commit is contained in:
Mario Pietsch
2026-08-21 22:31:21 +02:00
parent 6680967875
commit 09267a24b0
@@ -36,39 +36,30 @@ The default value of the tooltip attribute is supplied by the <<.vlink tv-wikili
This means that you can control the text of a link tooltip in several ways:
```
<$link to="HelloThere" tooltip="Custom tooltip">Link 1</$link>
<<wikitext-example-without-html """<$link to="HelloThere" tooltip="Custom tooltip">Link 1</$link>""">>
<$link to="HelloThere" tooltip="Another tooltip">{{$:/core/icon}}</$link>
<<wikitext-example-without-html """<$link to="HelloThere" tooltip="Another tooltip">{{$:/core/icon}}</$link>""">>
<$set name="tv-wikilink-tooltip" value="I'm a link to {{!!title}}">
<<wikitext-example """<$set name="tv-wikilink-tooltip" value="I'm a link to <$text text={{!!title}}/>">
<$link to="HelloThere">Link 2</$link>
</$set>
```
Renders as:
<$link to="HelloThere" tooltip="Custom tooltip">Link 1</$link>
<$link to="HelloThere" tooltip="Another tooltip">{{$:/core/icon}}</$link>
<$set name="tv-wikilink-tooltip" value="I'm a link to {{!!title}}">
<$link to="HelloThere">Link 2</$link>
</$set>
</$set>""">>
Note that the tooltip is rendered with the current tiddler set to the target of the link.
A useful convention is to set the tooltip like this:
```
\define tv-wikilink-tooltip()
<$transclude field="tooltip"><$transclude field="title"/></$transclude>
<<wikitext-example-without-html """\procedure tv-wikilink-tooltip()
<$let tv-wikilinks="no"><$transclude $field="tooltip"><$transclude $field="title"/></$transclude></$let>
\end
```
<$link to="SampleTabThree">Link 3</$link> has a ''tooltip'' field, so the tooltip is its content.
<$link to="HelloThere">Link 4</$link> has none, so the title is used instead.""">>
This causes the tooltip to be the ''tooltip'' field of the target tiddler. If the field isn't present, then the title is used instead.
Setting <<.vlink tv-wikilinks>> to `no` keeps the tooltip from generating links of its own.
! Action Variables
<<.from-version "5.4.0">> The <<.var actionTiddler>> variable is available to <<.param startaction>> and <<.param endaction>>.