Need location of tiddler controlling link behavior

68 views
Skip to first unread message

Robert Payne

unread,
Aug 4, 2021, 10:55:26 AM8/4/21
to TiddlyWiki
I am trying to locate the code that controls what happens when a link is clicked inside the tiddlywiki so that I can create a custom shadow tiddler that overrides the default behavior.
Can someone tell me where it is?

PMario

unread,
Aug 4, 2021, 3:18:12 PM8/4/21
to TiddlyWiki
Hi,
If a link is clicked, TW sends a tm-navigate message, which is catched by the navigator widget.
There is a link-catcher widget, which will allow you to do a different thing instead using action widget.

If you would be more concrete, what you try to achieve we could probably point you in the exact direction.

Especially, if you want to control clicks in the story-river or if you want to change links in the sidebar. There is a big difference, where to place your changes.

In the meantime have a closer look at. https://tiddlywiki.com/#LinkCatcherWidget

have fun!
-mario

Robert Payne

unread,
Aug 4, 2021, 4:37:15 PM8/4/21
to TiddlyWiki
Thanks Mario.
I am trying to get link clicks to go anchors within the same tiddler, instead of the default action of looking for a tiddler external to the current tiddler.

TW Tones

unread,
Aug 4, 2021, 8:58:32 PM8/4/21
to TiddlyWiki
rpayn...

Some notes from the coalface
  • Most website have separate web pages for each apparent page, and as a result anchors are unique to each page. With tiddlywiki all the content resides, in effect, in a single page. As a result there are some neuences using anchors within a tiddler. If they are the same as in other tiddlers you may get some odd behaviour, if more than one tiddler is visible. There was some hacks in the past that made this possible with the manual entry (I recall something about using "##"). 
  • However in recent times there have been advances in this area that are yet to play out, basically looking at creating unique html id's based on both the tiddlername (or serial number) and incrementally numbered (in the one tiddler).
  • In the meantime most of your needs are addressed in the documentation here  Anchor Links using HTML
  • HTML can be used to a great extent in tiddlywiki in addition to Wikitext so if you know how to do it in html then you can possibly do it in tiddlywiki, and in some cases you can even programmatically name tags attributes or provide attribute values to html see my documentation and the second section ❷ Widget and HTML attributes or parameters this then allows you to name anchors etc... 
Regards
Tones
Reply all
Reply to author
Forward
0 new messages