2014-10-08 16:45:26 +00:00
|
|
|
caption: tm-new-tiddler
|
2014-02-26 19:55:42 +00:00
|
|
|
created: 20140226194405353
|
2014-11-26 11:22:20 +00:00
|
|
|
modified: 20141107132122081
|
2014-09-11 14:52:47 +00:00
|
|
|
tags: Messages navigator-message
|
2014-08-28 20:43:44 +00:00
|
|
|
title: WidgetMessage: tm-new-tiddler
|
2014-02-26 19:55:42 +00:00
|
|
|
type: text/vnd.tiddlywiki
|
|
|
|
|
|
|
|
The new tiddler message creates a new draft tiddler and adds it to the current story. It requires the following properties on the `event` object:
|
|
|
|
|
|
|
|
|!Name |!Description |
|
2014-11-26 11:22:20 +00:00
|
|
|
|param |The optional title of a tiddler to use as a template for the new tiddler |
|
|
|
|
|paramObject |Optional hashmap of additional tiddler fields |
|
2014-02-26 19:55:42 +00:00
|
|
|
|navigateFromTitle |Title of the tiddler from which the navigation to the new tiddler was initiated |
|
|
|
|
|
2014-10-09 16:30:53 +00:00
|
|
|
The title for the draft tiddler is chosen according to these rules:
|
|
|
|
|
|
|
|
* If a hashmap was used and a title field was specified, use that title
|
2014-11-26 11:22:20 +00:00
|
|
|
* If a template tiddler was used, use the title of the template tiddler, making it unique with a numeric suffix
|
|
|
|
* Otherwise, generate a new title based on the default new tiddler title with a numeric suffix to make it unique
|
2014-10-09 16:30:53 +00:00
|
|
|
|
2014-10-21 12:25:27 +00:00
|
|
|
The new tiddler message is usually generated with the ButtonWidget or ActionSendMessageWidget and is handled by the NavigatorWidget.
|
2014-07-24 22:07:02 +00:00
|
|
|
|
2016-04-04 11:45:31 +00:00
|
|
|
! Examples
|
2014-07-24 22:07:02 +00:00
|
|
|
|
|
|
|
To make a button that creates new tiddlers tagged "task", create a tiddler called "TaskTemplate" with that tag, and then make your button like this:
|
|
|
|
|
|
|
|
```
|
2014-08-28 20:43:44 +00:00
|
|
|
<$button message="tm-new-tiddler" param="TaskTemplate">New Task</$button>
|
2014-07-24 22:07:02 +00:00
|
|
|
```
|
2016-04-04 11:45:31 +00:00
|
|
|
|
|
|
|
To create a new tiddler with given attributes rather than from a template:
|
|
|
|
|
|
|
|
```
|
|
|
|
<$button>
|
|
|
|
<$action-sendmessage $message="tm-new-tiddler" title="This is newly created tiddler" tags="OneTag [[Another Tag]]" text=<<now "Today is DDth, MMM YYYY">>/>
|
|
|
|
New Tiddler
|
|
|
|
</$button>
|
|
|
|
```
|