I’ve got a <$button> that stores the title of a random book tiddler in a field, random-suggestion. I’m then displaying a link to that tiddler with:
<$link to={{!!random-suggestion}}>{{!!random-suggestion}}</$link>
which essentially displays a link with Title as its text.
I want to also display the author field from the tiddler titled {{!!random-suggestion}} so I’ll end up with a Author - Title link .
What is the most TW-like manner to do that?
(I haven’t tested this)
Off the top of my head:
<$link to={{!!random-suggestion}}><$text text={{{ [{!!random-suggestion}] [[ - ]] [{!!random-suggestion}get[author]] +[join[]] }}}</$text></$link>
Your suggestion was 99% of what I wanted. Here’s what I settled with:
<$link to={{!!random-suggestion}}>
<$text text={{{ [{!!random-suggestion}] [{!!random-suggestion}get[author]enlist-input[]] +[join[ - ]] }}} />
</$link>
- Use
join[ - ] to simplify building the final string
- Use
enlist-input[] after author so values like [[Name Surname]] render properly without the square brackets.
Thank you!
Ah, you store brackets with author name. Is that because you might have more than one author in the author field ?
Oops, I just noticed that I flipped the order: I gave title - author instead of author - title.
Indeed 
Also, by using double brackets, when I type in the author field I’m assisted by Evidently Cube’s Auto Complete Plugin.