multiple same-word links to unique tiddlers

12 views
Skip to first unread message

Dave Parker

unread,
Aug 10, 2007, 1:02:46 PM8/10/07
to TiddlyWiki
Does this exist and I just can't find it?:

I'd like to be able to write a link, say [[Theme]] (but would probably
different brackets) and have it automatically generate a pretty link-
type thing based on the tiddler its in, so when I click Theme in
tiddler A it goes to the version of Theme for tiddler A and not the
Theme for tiddler B.

I confess I've been bad and haven't learned enough about fields yet -
is this a job for fields? maybe you can have a pop-up from a link or
mouse hover-over reveal the "Theme" field for that tiddler. I guess
the next logical question is: can a field's content be a tiddler
title/link?


Dave Parker

FND

unread,
Aug 10, 2007, 1:24:41 PM8/10/07
to Tiddl...@googlegroups.com
> automatically generate a pretty link-type thing based on the
> tiddler its in

Try this:
http://devpad.tiddlyspot.com/index.html#RelativeLinkMacro


-- F.

Dave Parker

unread,
Aug 10, 2007, 1:46:23 PM8/10/07
to TiddlyWiki
Hey, thanks very much - it works great!

related question:
here's what worked -
<<relLink "/ThemeTiddler">> which looked in view mode like: "tiddler B/
ThemeTiddler"


I tried to envelope the macro in a pretty link format:
[[theme|<<relLink "/ThemeTiddler">>]] which looked like
"theme" (underlined)
and it didn't work - wanted to link to an external file which it
couldn't find

any suggestions?

schilke

unread,
Aug 10, 2007, 2:37:15 PM8/10/07
to TiddlyWiki
umm, just curious if you mean a simple link to a(nother) tiddler with
a different _link title_?
(because that's what it sounds like - for me...)
That would be a bit easier: [[Link this link to Theme B please|
ThemeBTiddler]]

FND

unread,
Aug 10, 2007, 2:37:20 PM8/10/07
to Tiddl...@googlegroups.com
> Hey, thanks very much - it works great!

Wasn't too hard; basically a one-liner.

> related question:
> here's what worked -
> <<relLink "/ThemeTiddler">> which looked in view mode like: "tiddler B/
> ThemeTiddler"


> I tried to envelope the macro in a pretty link format:
> [[theme|<<relLink "/ThemeTiddler">>]] which looked like
> "theme" (underlined)

Thanks for making me aware that I had forgotten about link titles.
I've updated the macro with an (optional) second parameter:
http://devpad.tiddlyspot.com/index.html#RelativeLinkMacro

> it didn't work - wanted to link to an external file which it
> couldn't find

This doesn't seem to be the macro's fault; seems like PrettyLinks
interpret all targets with a slash in their title as external links!?
Can anyone confirm this bug?


-- F.

schilke

unread,
Aug 10, 2007, 2:39:20 PM8/10/07
to TiddlyWiki
Google Groups system even hacks TiddlyWiki links to death, LOL

Again:

Dave Parker

unread,
Aug 10, 2007, 3:41:08 PM8/10/07
to TiddlyWiki

I don't think thats what I mean - sounds like you're describing a
simple pretty link

Dave Parker

unread,
Aug 10, 2007, 3:48:02 PM8/10/07
to TiddlyWiki
FND: thanks, I got your update - it's perfect!

FYI, your eg was this:<<relLink "sub-tiddler" ["link title"]>>
revealing "["link title"]"

but it also works if you do this: <<relLink "sub-tiddler" link title>>
revealing "link title"

Thanks again for your rapid response
(if I come up with another wildly speculative request I won't expect
such a magic answer every time - : ) )

DP

FND

unread,
Aug 10, 2007, 3:50:52 PM8/10/07
to Tiddl...@googlegroups.com
> FYI, your eg was this:<<relLink "sub-tiddler" ["link title"]>>
> revealing "["link title"]"

The brackets are tech talk for optional arguments/parameters.

> Thanks again for your rapid response
> (if I come up with another wildly speculative request I won't expect
> such a magic answer every time - : ) )

*phew*!


-- F.

Morris Gray

unread,
Aug 10, 2007, 4:38:02 PM8/10/07
to TiddlyWiki
It is early in the morning and I'm thicker in the head than usual but
this bewilders me. Can you explain more throughly what this does;
maybe with a detailed example?

Morris Gray
http://twhelp.tiddlyspot.com
A TiddlyWiki help file for beginners

FND

unread,
Aug 10, 2007, 5:11:15 PM8/10/07
to Tiddl...@googlegroups.com
> It is early in the morning and I'm thicker in the head than usual but
> this bewilders me. Can you explain more throughly what this does;
> maybe with a detailed example?

It simply adds the current tiddler to the desired pretty link - think of
it as relative paths:
So if you put
<<relLink "_phone">>
into the tiddler "Bob", it will link you to "Bob_phone".
However, if you put it into the tiddler "John", the link will take you
to "Johne_phone".

I'm not sure what Dave might actually need this for though.


-- F.

Dave Parker

unread,
Aug 10, 2007, 5:38:39 PM8/10/07
to TiddlyWiki
Here's why I like it (from a "user's" perspective):

I can copy the little macro and paste the exact same thing into
multiple tiddlers, or better yet, have it in a template and when it
gets used (say to comment on the theme of a particular text (something
that I'll be doing on multiple texts)) it automatically gets made with
the specific name reference relative to whichever tiddler you're
commenting from without me having to type anything or think of a
unique name.

Dave

schilke

unread,
Aug 10, 2007, 6:56:38 PM8/10/07
to TiddlyWiki
> It simply adds the current tiddler to the desired pretty link - think of
> it as relative paths:
> So if you put
> <<relLink "_phone">>
> into the tiddler "Bob", it will link you to "Bob_phone".

now I got it, too :-}
Nice stuff.

Morris Gray

unread,
Aug 10, 2007, 7:24:31 PM8/10/07
to TiddlyWiki
Ah ha! How interesting; so it concatenates the title of the tiddler
with whatever appendage you wish to add and creates a pretty link to
it, and it seems that destination has to already exist.

I found 'relative' a bit misleading it is actually creating an
absolute link. So it really creates an absolute link 'related
to' but not 'relative to' whatever tiddler it is in; very
fuzzy :). I'll have to invent a reason for using it.

Morris Gray
http://twhelp.tiddlyspot.com
A TiddlyWiki help file for beginners

Eric Shulman

unread,
Aug 11, 2007, 12:52:51 AM8/11/07
to TiddlyWiki
> > automatically generate a pretty link-type thing based on the
> > tiddler its in
> http://devpad.tiddlyspot.com/index.html#RelativeLinkMacro

You could also use
http://www.TiddlyTools.com/#WikifyPlugin
which provides a simple method for constructing dynamic wiki content
from values contained in tiddlers (e.g., standard fields, custom
fields, and slices)

<<wikify "[[theme|%0_theme]]" title>>

The first param is the format, using %0 through %9 as 'substitution
markers'. The remaining parameters provide the corresponding values
to substitute into the format string. You can access any tiddler
field, including a custom field, just by specifying its name (title,
created, modified, modifier, text, tags). You can also access tiddler
slice values using "tiddlername::slicename" syntax (use the special
keyword "here" to refer to the current tidder (e.g.
"here::slicename").

Of course, <<wikify>> can construct more than just TiddlyLinks based
on the current tiddler title... you can also use it to generate and
render lots of different kinds of wiki syntax, and you can even use
the macro to embed dynamic wiki syntax directly into a template.

-e
Eric Shulman
TiddlyTools / ELS Design Studios

Reply all
Reply to author
Forward
0 new messages