Display all values of a field as links

I want all values in a field displayed as links in the body of the same tiddler.

For instance, ‘related’ field of ‘TidA’ contains:

Queen Prince King [[Queen Victoria]] PrinceCharles

With {{!!related}},
‘Queen Victoria’ and ‘PrinceCharles’ are displayed as links. But ‘King’, ‘Queen’ and ‘Prince’ are not displayed as link.

<$view field="related" format="" />

using different formats does not produce desired results.

<$transclude field="related" />

produces exactly same results as {{!!related}} both, probably mean the same thing.

I guess $wikify will need to get involved. But I have not been able to get it working.

How do I get all values displayed as links?

try this

<$list filter="[enlist{!!related}]">
<$link />, 
</$list>

@pmario Thanks. And it worked perfectly. I polished it a bit with:

<$vars last={{{ [<currentTiddler>get[related]enlist-input[]last[]] }}}>
  <$list filter="[enlist{!!related}]">
    <$link />
    <$text text={{{ [<currentTiddler>!match<last>then[, ]] }}}/>
  </$list>
</$vars>

to remove the ‘,’ after the last item.

The code is not my own. I picked it up from an answer to another question here.

1 Like