Creating a Link That References to a Specific Part of a Tiddler

47 views
Skip to first unread message

MrMakeveli

unread,
Dec 22, 2008, 8:15:06 PM12/22/08
to TiddlyWiki
I recently came across PartTiddler Plugin to somewhat do this task. Is
there another way to do this? I was hoping to be able to create a link
that would open the Tiddler and bring it to a specific portion of it.
The PartTiddler Plugin so far only grabs that specific chunk, but not
the rest of the tiddler. I've thought about implementing some anchors
in html but I was hoping to find another less laborious way.

Also, one of the reasons I'm somewhat avoiding using the PartTiddler
plugin is because when it calls the section out, it shows the PartName
in the title (which is often very unattractive). If I could make that
disappear then PartTiddler might suffice.

Here is how I'm using it:

On my main menu I have nested sliders.
One of those catagories is Applications.
I aim to have a few subcatagories, such as Current, Recommended,
Opensource, Maintenance, etc

I have a single tiddler named Applications that those catagories in
it, with a ForEachTiddler that generates a list based off of the
relevant tags (e.g. applications+current, or applications+opensource).

So I <part>'d the "Current" section of it and partname'd it
'currentapps'.

In my main menu it looks like
Applications
[[Current|Applications/currentapps]]

and it works fine and dandy but when its displayed I get a heading
that looks like
Applications/currentapps

It does pull up the relevant info I just wish it didn't have that
title.

Anything I can do?

Eric Shulman

unread,
Dec 22, 2008, 9:38:47 PM12/22/08
to TiddlyWiki
> I recently came across PartTiddler Plugin to somewhat do this task. Is
> there another way to do this? I was hoping to be able to create a link
> that would open the Tiddler and bring it to a specific portion of it.

You can use TW's heading syntax (! through !!!!!) to define "sections"
within a tiddler, like this:

[[SomeTiddler]]
content
...
!heading1
...
!heading2
...
etc.

Each section is 'named' using the text of the heading, and continues
until either the next heading or the end of the tiddler. To
transclude a specific section of one tiddler into another tiddler, use
the heading text like this:

<<tiddler [[SomeTiddler##heading1]]>>

Unfortunately, while the TW core allows you to transclude sections, it
doesn't currently support *links* that open and scroll to a given
section.

Fortunately, I've written a "core tweak" that extends the TW core's
link handling to recognize section names. First, install this
tiddler:
http://www.TiddlyTools.com/#CoreTweaks

Then, after saving-and-reloading (so the tweak can take effect), you
can use the following link syntax:
[[SomeTiddler##heading1]]
or
[[text to show|SomeTiddler##heading1]]

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

MrMakeveli

unread,
Dec 22, 2008, 10:12:38 PM12/22/08
to TiddlyWiki
> Then, after saving-and-reloading (so the tweak can take effect), you
> can use the following link syntax:
>    [[SomeTiddler##heading1]]
> or
>    [[text to show|SomeTiddler##heading1]]

Perfect!
Jon

Eric Shulman

unread,
Dec 23, 2008, 12:11:49 PM12/23/08
to TiddlyWiki
> >    [[SomeTiddler##heading1]]
> > or
> >    [[text to show|SomeTiddler##heading1]]

Note: the extended linking syntax can also be used with permalinks.
For example, this link:
http://www.tiddlytools.com/#CoreTweaks##784
will take you directly to the section of CoreTweaks that contains the
code for adding 'section link' handling

enjoy,
-e


Reply all
Reply to author
Forward
0 new messages