Transclude field value as a link

103 views
Skip to first unread message

Alexei R

unread,
Aug 1, 2018, 9:49:40 AM8/1/18
to TiddlyWiki
Why following exsample doesnt works?
I have tiddler with field named myfield1 that has value 22.
I would like to transclude / show myfield1 value into tiddler text area as a link.
When I enter [[{{!!myfield1}}]] expression as tiddler's text it rendered as link {{!!myfield1}} instead of link 22 as I would expect.

At other hand I always can assign value [[22]] to myfield1 field. And transclude it just with {{!!myfield1}} expression.
But it not acceptable for me by some unrelated reason.

FrD

unread,
Aug 1, 2018, 9:57:45 AM8/1/18
to TiddlyWiki
Hi,

Try :

<$link to={{!!myfield1}}>{{!!myfield1}}</$link>



Regards

FrD

Alexei R

unread,
Aug 1, 2018, 10:42:09 AM8/1/18
to TiddlyWiki
Thank you it is working!
But intuitively this solution feels a bit complicated for such elegant tool as TiddlyWiki .
It must be more laconic way....
Isn't it possible to replace <$link to={{!!myfield1}}> expression with some kind of brackets?

Jed Carty

unread,
Aug 1, 2018, 10:42:33 AM8/1/18
to TiddlyWiki
Outside of filters, anything inside [[ and ]] is rendered as a link with the literal text inside being treated as the target of the link without substitutions because things inside the links often shouldn't be wikified. {{!!myfield1}} isn't changed because it is assumed to be the literal target of the link. Determining when to wikify things inside the link syntax would be a very difficult task and would come with its own set of strange and unexpected behaviour. It is simpler to just say that everything inside [[ and ]] is treated as a string literal and provide alternate methods (like FrD suggested) to make links with references.
Reply all
Reply to author
Forward
0 new messages