Use caption of linked to Tiddler

After trying various solutions I found, nothing is working. ^_^;;

What I have:
Tiddler A

  • (field) pseudonym: Jon

Tiddler B

  • field01: Tiddler A

TiddleTemplate

<$link to={{!!field01}}><$transclude tiddler="{{!!field01}}" field="pseudonym">{{!!field01}}</$transclude></$link>

Expected output/source:

<a href="#Tiddler A">Jon</a>

But it is not working. It just keeps on displaying the title of the tiddler.

I also tried (based on https://tiddlywiki.com/#Linking%20in%20WikiText ):

<$link to={{!!field01}}>{{!!pseudonym}}</$link>

But the {{!!pseudonym}} is always taking its value in the currenttiddler, not the value found in to=.

Another I tried:

<$transclude $tiddler="{{!!field01}}" $field="pseudonym"/>

There are others I’ve tried but I can no longer remember.

I’m don’t know what I’m doing wrong.

The delimiters around widget parameters indicate how to process those parameters:

  • literal values are enclosed in quotes: "sometext"
  • field references are enclosed in double curly brackets: {{!!fieldname}}
  • variable references are enclosed in double angle brackes: <<variablename>>

Thus, for your example code you should not use quotes around the tiddler=... parameter value:

<$link to={{!!field01}}>
   <$transclude tiddler={{!!field01}} field="pseudonym">{{!!field01}}</$transclude>
</$link>

enjoy,
-e

1 Like

Ahh! Thank you again! I’ll have to be careful with it. ^^;;