[[<<tiddler valueTid>>|valueTid]]

65 views
Skip to first unread message

julien23

unread,
Jul 31, 2012, 11:00:22 AM7/31/12
to tiddl...@googlegroups.com
Hi all

I have a tiddler with a value in the text :

[[valueTid]]
26

What is the syntax to write "26" as a wiki link to [[valueTid]] ?

[[<<tiddler valueTid>>|valueTid]]

Does not work...

Thanks

Julien

Eric Shulman

unread,
Jul 31, 2012, 3:01:43 PM7/31/12
to TiddlyWiki
What you want to do is to retrieve the 'text' content from the
tiddler, and then use it as the display text for a link to that
tiddler. However, you can't use the <<tiddler>> macro to retrieve the
value, because TW macros don't "return text" that is then processed...
rather, they directly render their own output. Thus, you can't embed
macros calls within other TW syntax.

Unfortunately, there is no direct syntax in TW that allows you to
fetch and embed a tiddler field value (e.g. the 'text' field) within
the TW link syntax. Fortunately, I've written a plugin that let's you
do exactly that (and more):
http://www.TiddlyTools.com/#WikifyPlugin
http://www.TiddlyTools.com/#WikifyPluginInfo

Using the <<wikify>> macro, you can then write:
<<wikify "[[%0|TiddlerName]]" text@TiddlerName>>

The first param, "[[%0|TiddlerName]]" is the 'format' for the output,
where %0 marks the 'insertion point' for embedding the value retrieved
from the tiddler. The second param, "text@TiddlerName" is the plugin-
defined reference for the desired tiddler field content (i.e.,
fieldname@TiddlerName).

The macro gets the value from the tiddler and then constructs the
indicated TW syntax (in this case, a "pretty link"). The result is
then automatically rendered, producing the desired link output.
Q.E.D.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...
http://www.TiddlyTools.com/#Donations

Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:
http://www.TiddlyTools.com/#Contact

Eric Shulman

unread,
Jul 31, 2012, 5:45:39 PM7/31/12
to TiddlyWiki
[moderator fixed message subject text]

julien23

unread,
Aug 1, 2012, 3:37:16 AM8/1/12
to tiddl...@googlegroups.com
Hi Eric

Indeed it is a bit more tricky because I would like to use it in a FET :

<<forEachTiddler
    where
        'tiddler.tags.contains("$1") && tiddler.tags.contains("$2") && !tiddler.tags.contains("attachment")'
    sortBy
        tiddler.title
    ascending
   write
 '((index == 0) ? "" : " - ")+"<<wikify [[%0|"+tiddler.title+"]] text@"+tiddler.title+"$))"'
>>

Because of the " of the wikify syntax I can't have it work ... I am not sticking to FET and this case may be a limit.

Looking forward to read from you

julien
Reply all
Reply to author
Forward
0 new messages