Variables in links

52 views
Skip to first unread message

Luis Gonzalez

unread,
Feb 24, 2020, 3:43:00 AM2/24/20
to TiddlyWiki
I can't find the way of adding a variable to a link:



Enter the code of the center: <$edit-text tiddler="$:/kewa/status" field="codcenter"/>

<$set name="themail" tiddler="Mail-codes" index={{$:/kewa/status!!codcenter}}>
[ext[mailto:<themail>]]
</$set>


What is the variables syntax in links????
I've tried with [ext[mailto:<<themail>>]], [ext[mailto:{{Mail-codes##<<themail>>]], [ext[mailto:$themail$]] and many others.

Mat

unread,
Feb 24, 2020, 5:47:20 AM2/24/20
to TiddlyWiki
Maybe there are other ways but I'd say it's a typical macro case:

\define mylink() [ext[mailto:$(themail)$]]


<$set name="themail" tiddler="Mail-codes" index={{$:/kewa/status!!codcenter}}>
<<mylink>>
</$set>


<:-)

Luis Gonzalez

unread,
Feb 24, 2020, 6:25:44 AM2/24/20
to TiddlyWiki
Thank you!!


I've found other "tricky" solution with variables:


Enter the code: <$edit-text tiddler="$:/kewa/status" field="codcenter"/>

<$set name="the_mail" tiddler="Mail-codes" index={{$:/kewa/status!!codcenter}}>
<$set name="the_link" filter="[<the_mail>addprefix[mailto:]]">
<a href=<<the_link>>><<the_mail>></a>
</$set>
</$set>




Reply all
Reply to author
Forward
0 new messages