1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-27 10:30:28 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-new-tiddler.tid
Jermolene 3827f98a43 Improve new tiddler behaviour with existing tiddlers
Now repeatedly clicking “new journal” will reuse the existing journal
if one exists
2014-10-09 17:30:53 +01:00

29 lines
1.3 KiB
Plaintext

caption: tm-new-tiddler
created: 20140226194405353
modified: 20141008142952355
tags: Messages navigator-message
title: WidgetMessage: tm-new-tiddler
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 |
|param |Either the title of a tiddler to use as a template for the new tiddler or a hashmap of tiddler fields |
|navigateFromTitle |Title of the tiddler from which the navigation to the new tiddler was initiated |
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
* If a hashmap was used without a title field, use a default title, if necessary making it unique with a numeric suffix
* If a template tiddler was used, use the title of the template tiddler, if necessary making it unique with a numeric suffix
The new tiddler message is usually generated with the LinkWidget, ButtonWidget or ActionSendMessageWidget and is handled by the NavigatorWidget.
! Example
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:
```
<$button message="tm-new-tiddler" param="TaskTemplate">New Task</$button>
```