Anchor links to other tiddlers?

Is it possible to do this? I know you can use HTML to create links to anchors in any rendered tiddler, but what if you want to create a link to a tiddler that isn’t rendered? Something like [[Link Text|TargetTiddler#AnchorName]], which would open the TargetTiddler and then scroll to AnchorName

Give this a try… create a tiddler containing this button:

<$button class="tc-btn-invisible" actions="<$action-navigate $to='HelloThere' $scroll=no />">
   <a href="##TestAnchor">goto ~TestAnchor</a>
</$button>

Then, somewhere in HelloThere, add an anchor, like this:

<a id="#TestAnchor"></a>

When you click on the button, if the HelloThere tiddler is not rendered yet, the $action-navigate will open it in the Story River without scrolling to it (so the button stays visible). Then, click the button AGAIN to trigger the anchor link. Note that, if HelloThere is already in the Story River, then only one click is needed to trigger the anchor link.

Admittedly, its a bit of a hack, but it gets you there.

enjoy,
-e

1 Like

3 posts were split to a new topic: How can we Create Vertical Tabs rotated by 90°

@linonetwo There is a pending PR at GitHub - Feat: allow link to section mark by linonetwo · Pull Request #7744 · Jermolene/TiddlyWiki5 · GitHub which will allow us to create “anchor-links” with TW syntax.

It’s stalled for some time - So if you want to give it some more “live” comment there, so there is a chance to get it into the “next” TW version.

Preview (do not use for production) - AnchorWidget

2 Likes

Thanks @pmario - this is nice - but not quite there.

Ideally - I want to click on a link from any tiddler - and go to any other tiddler.

BUT:

  • I have the “any other tiddler” - already in “Right Cell” - just not shown

Currently - it opens “any other” - in the story river.

Thanks for your help

:slight_smile: