Using Image Map in TW5 to link to certain tiddlers

769 views
Skip to first unread message

Oliver Nick

unread,
Jan 9, 2014, 9:12:48 AM1/9/14
to tiddl...@googlegroups.com
Hello!

I'm new to TiddlyWiki5 and I'm looking for a way to use an image map within my tiddlywiki.

I'd like to have an image wherein I can click on different parts of that image to open certain tiddlers. So this is supposed to be a means of navigation. Both the image map and the target tiddlers are within my tiddlywiki.

I can insert images in a tiddler.
I can use html in a tiddler.
I know how to do an image map in html.
TiddlyWiki does recognize the link within the image.

If I fill in an external link, e.g.
<map name="somename">
   <area shape="rect" coords="1,2,3,4"
         href="http://www.google.com" alt="google" title="google">
</map>
it works fine.

But how can I make this open a desired tiddler?

Jeremy Ruston

unread,
Jan 9, 2014, 5:38:22 PM1/9/14
to TiddlyWiki
Hi Oliver

TW5 would need modification to be able to use tiddler links within image maps. It's a good idea, but I don't have immediate plans to add it due to time constraints. I've opened a ticket to keep track of the idea:


Best wishes

Jeremy.





--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/groups/opt_out.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

Oliver Nick

unread,
Jan 10, 2014, 8:34:48 AM1/10/14
to tiddl...@googlegroups.com, jeremy...@gmail.com
Hi Jeremy

Is it really necessary to "be able to use tiddler links within image maps" to achieve what I want?
Ain't there a possibility to open a certain tiddler via an html link? (I read about using "#", but that seems to only work in TWc.)
Or can one use a short line of java script within the html image map to tell TW5 to open some tiddler?

Jeremy Ruston

unread,
Jan 10, 2014, 11:19:47 AM1/10/14
to Oliver Nick, TiddlyWiki
It's not currently possible to create tiddler links in HTML; a JavaScript event handler is needed, and that event handler needs to execute in the right context of the widget render tree. The mechanism is more complicated than you might expect because it supports multiple stories on the page at once.

As a hack, one could imagine adding a document event handler that traps clicks on any element with an HREF and navigates to the target tiddler using the default story. (There isn't really any concept of a default story at the moment, though).

Best wishes

Jeremy.

Oliver Nick

unread,
Jan 10, 2014, 2:19:33 PM1/10/14
to tiddl...@googlegroups.com, Oliver Nick, jeremy...@gmail.com
OK. Thanks for your fast reply.

Eric Shulman

unread,
Jan 10, 2014, 3:22:15 PM1/10/14
to tiddl...@googlegroups.com, Oliver Nick, jeremy...@gmail.com
On Friday, January 10, 2014 8:19:47 AM UTC-8, Jeremy Ruston wrote:
It's not currently possible to create tiddler links in HTML; a JavaScript event handler is needed, and that event handler needs to execute in the right context of the widget render tree. The mechanism is more complicated than you might expect because it supports multiple stories on the page at once.
As a hack, one could imagine adding a document event handler that traps clicks on any element with an HREF and navigates to the target tiddler using the default story. (There isn't really any concept of a default story at the moment, though).

just a thought... no idea how viable:

If there is a way to get to the underlying "widget render tree" then it might be possible to add onclick="..." event handlers directly on the AREA elements of the image map so they can be invoked with the correct context (using the .call() method), so that the clicks don't have to be trapped at the document level and the current story context can be used without introducing the context-free "default story" concept.

-e

Tobias Beer

unread,
Jan 21, 2015, 6:13:08 PM1/21/15
to tiddl...@googlegroups.com
Just thought I'd mention it here, this seems to work (now).


Best wishes, Tobias.
Reply all
Reply to author
Forward
0 new messages