2020-11-17 14:43:46 +00:00
caption: tm-modal
2014-08-11 12:17:11 +00:00
created: 20140811112133701
2020-11-17 14:43:46 +00:00
modified: 20201117081247738
2014-09-11 14:52:47 +00:00
tags: Messages
2014-08-28 20:43:44 +00:00
title: WidgetMessage: tm-modal
2014-08-15 09:06:19 +00:00
type: text/vnd.tiddlywiki
2014-08-11 12:17:11 +00:00
|!Name |!Description |
|param |Title of the tiddler to be displayed |
2020-11-17 14:43:46 +00:00
|paramObject |Hashmap of variables to be provided to the modal, contains all extra parameters passed to the widget sending the message. |
2018-11-18 20:57:04 +00:00
|rootwindow |<<.from-version 5.1.18>> ''yes'' or ''true'' will always display a modal in the wiki-root-window |
2014-11-26 11:22:20 +00:00
2014-08-11 12:17:11 +00:00
The modal message is usually generated with the ButtonWidget. The modal message is handled by the TiddlyWiki core.
2014-11-26 11:22:20 +00:00
2023-01-12 20:59:34 +00:00
[[Fields within the tiddler|Modals]] being displayed in the modal can be used to customise its appearance.
2020-11-17 14:43:46 +00:00
2022-12-03 17:26:44 +00:00
!! paramObject
The "currentTiddler" variable is set to the title of the modal tiddler, but can be overridden by specifying a different value in `paramObject`.
2014-11-26 11:22:20 +00:00
! Example
Here is an example of displaying a modal and passing parameters to it:
2020-11-17 14:43:46 +00:00
(Note how all parameters to `action-sendmessage` other than `$param` and `$message` are available as variables within the modal.)
2014-11-26 11:22:20 +00:00
<$macrocall $name='wikitext-example-without-html'
src='Your name: <$edit-text tiddler="$:/temp/yourName" tag="input" default="Your name"/>
Your message:
<$edit-text tiddler="$:/temp/yourMessage" default="Your message"/>
<$button>
<$action-sendmessage $message="tm-modal" $param="SampleModal" yourName={{$:/temp/yourName}} yourMessage={{$:/temp/yourMessage}}/>
Click me!
</$button>'/>
2020-11-17 14:43:46 +00:00
2018-11-18 20:57:04 +00:00
<<.tip """<$macrocall $name=".from-version" version="5.1.18"/> if triggered from within a ''new window'', the above examples will be displayed within that window. The <$macrocall $name=".attr" _="rootwindow"/> attribute can be set to ''yes'' or ''true'' to inherit this behavior and to display the Modal within the ''root'' window""">>
2020-11-17 14:43:46 +00:00
<<.tip """<$macrocall $name=".from-version" version="5.1.23"/> Links to tiddlers within a modal will open in the same story as the widget that sent the `tm-modal` message. You can override this by specifying values for the variables `tv-story-list` and `tv-history-list` when sending the `tm-modal` message.
""">>