navigation in modal window TW 5.1.23

191 views
Skip to first unread message

Atronoush

unread,
Dec 28, 2020, 12:19:12 PM12/28/20
to TiddlyWiki

In TW 5.1.23 the modal window has improved.
How can I click on a link and open it inside modal window?


Mat

unread,
Dec 28, 2020, 12:55:03 PM12/28/20
to TiddlyWiki
As I understand it, it is not a matter of how you click a link. Rather, the modal is created from a widgetmessage which is typically insidea button(widget). See docs on Modals.
That said; opening a regular link via some special click is actually a really good idea! I can definitely see use for it when one wants to highlight some tiddler. Then LinkWidget doesn't have an action attribute so I think it would have to be modified.

<:-)

Mohammad Rahmani

unread,
Dec 29, 2020, 1:46:44 PM12/29/20
to tiddl...@googlegroups.com
Mat,
 I was not quite successful! I had to use a custom substroy to open the links in the same Modal, but it works!
This is nice to create a multi step wizard.

Cheers
Mohammad



Best wishes
Mohammad


--
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 view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/67fe1a01-bc2d-46f4-98be-544f510fd1e9n%40googlegroups.com.

Saq Imtiaz

unread,
Dec 29, 2020, 3:35:49 PM12/29/20
to TiddlyWiki
In 5.1.23, links within modals open in the main story. This is what the original behaviour was and what is desirable in most situations. However as of a few versions ago there was a regression and this stopped working, that is links within a modal did nothing at all.

If you want a link within a modal to open inside the same modal, you can set the content of the modal via  a transcluded tiddler that derives its value from a state tiddler, and use a linkcatcher to change the value of the state tiddler.

To open a tiddler in a modal you need to use a button with the tm-modal message. I did post a tweak a while back that allowed right clicking on a tiddler link to - amongst other things, open a tiddler in a modal.

Lastly note that there is an open PR to add actions to the LinkWidget.

Mat

unread,
Dec 29, 2020, 5:35:39 PM12/29/20
to TiddlyWiki
saq wrote:
Lastly note that there is an open PR to add actions to the LinkWidget.

I can't find this PR. Anybody care to provide a link.
Thanks.

<:-) 

Saq Imtiaz

unread,
Dec 29, 2020, 6:07:11 PM12/29/20
to TiddlyWiki
Apologies, I misspoke. I was thinking of the PR to add drag actions to the Link widget.

On second thought, adding actions to the LinkWidget doesn't seem all that useful. You would need to create links with the full widget syntax, at which point you may as well use the ButtonWidget.


Mat

unread,
Dec 29, 2020, 6:21:32 PM12/29/20
to TiddlyWiki
OK, thanks.


On second thought, adding actions to the LinkWidget doesn't seem all that useful. You would need to create links with the full widget syntax, at which point you may as well use the ButtonWidget.

I'd think Atronoush's idea is to let the clicking user decide if the link should open as a tiddler or as a modal. Comparable to how ctrl+click opens the tiddler without navigation. Come to think of it, then this is even more about bracket links than the linkwidget - but it is of course really about both.

<:-)

Jeremy Ruston

unread,
Jan 3, 2021, 6:34:39 AM1/3/21
to TiddlyWiki Group
You should be able to use the <$linkcatcher> widget with the actions attribute, something like this:

\define actions()
<$action-sendmessage $message="tm-modal" $param=<<navigateTo>>/>
\end

<$linkcatcher actions=<<actions>>>

HelloThere

</$linkcatcher>

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.

Atronoush

unread,
Jan 3, 2021, 1:39:44 PM1/3/21
to TiddlyWiki
Thank you all.

Yes as Mat explained I like to have short wizards (include 5 or more steps each in a separate tiddler) so on a click it should open next tiddler in the same modal window!
I will try  Jeremy's suggestion and will back to you.

--Atro
Reply all
Reply to author
Forward
0 new messages