[TW5] currentTiddler as argument to "$link to"

60 views
Skip to first unread message

Mat

unread,
May 5, 2015, 5:04:20 AM5/5/15
to tiddl...@googlegroups.com
Similar to Rustems question a mere half hour ago, but not the same (or?)
 
<table id="noborders">
   <$list filter="[removeprefix[$:/]]  +[sort[title]]">
      <tr><td><$link to=$:/<<currentTiddler>>>●</$link></td><td><<currentTiddler>></td></tr>
   </$list>
</table>

It's intended to produced a list (really a table) showing scrubbed titles (removing $:/) where the bullets ● are the links to them.

How do I get that "link to" to work?

Thank you!

<:-) 

Mat

unread,
May 5, 2015, 10:18:36 AM5/5/15
to tiddl...@googlegroups.com
I'm beginning to understand that the tricky bit is to have the link-widget "to" attribute accept a compound argument (i.e $:/ and <<currentTiddler>>) - is this at all possible?

<:-)

Eric Shulman

unread,
May 5, 2015, 10:25:48 AM5/5/15
to tiddl...@googlegroups.com
On Tuesday, May 5, 2015 at 7:18:36 AM UTC-7, Mat wrote:
I'm beginning to understand that the tricky bit is to have the link-widget "to" attribute accept a compound argument (i.e $:/ and <<currentTiddler>>) - is this at all possible?

You can use a macro to assemble the "compound argument"... and, because <<currentTiddler>> is a TiddlyWiki *variable*, you can apply text substitution inside the macro using $(currentTiddler)$, like this:

\define whereto()
$
:/$(currentTiddler)$
\end

<$link to=<<whereto>>>●</
$link>

Note that, in the macro, the "$:/" is literal text, while the $(currentTiddler)$ portion is the subtitution syntax.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

YOUR DONATIONS ARE VERY IMPORTANT!
HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...

Mat

unread,
May 5, 2015, 10:33:29 AM5/5/15
to tiddl...@googlegroups.com
Brilliant! thank you Eric!

<:-)
Reply all
Reply to author
Forward
0 new messages