이 문서는 https://tiddlywiki.com/languages/ko-KR/에서 티들리위키의 정적 HTML 표현의 일부입니다

ActionCreateTiddlerWidget

2024년 6월 2일 오후 3:32

Introduction

The $action-createtiddler widget is an action widget that creates new tiddlers. Action widgets are used within triggering widgets such as the ButtonWidget.

There are several differences from the tm-new-tiddler message:

  • The new tiddler is not automatically displayed in the story river
  • The title of the new tiddler is made available for subsequent operations

Content and Attributes

The action-createtiddler widget is invisible.

AttributeDescription
$basetitleThe initial title that will be attempted. If a tiddler with that title already exists, then a numerical counter is added to the title and incremented until it is unique
$savetitleDeprecated fromv5.1.20(seeActionCreateTiddlerWidget Example 5) A text reference identifying a field or index into which the title of the newly created tiddler will be stored after it is created
$savedrafttitleDeprecated fromv5.1.20(seeActionCreateTiddlerWidget Example 5) A text reference identifying a field or index into which the draft title associated with the newly created tiddler will be stored after it is created. This is useful when using a sequence of action widgets to create a new tiddler, put it into edit mode, and position it within the list of its parent tag
$timestampSpecifies whether the timestamp(s) of the target tiddler will be updated (modified and modifier, plus created and creator for newly created tiddlers). Can be "yes" (the default) or "no"
$templateIntroduced in v5.1.22 The title of a template tiddler, that will be used to create a new tiddler
$overwriteIntroduced in v5.1.22 If set to "yes", it will overwrite existing tiddlers. Be careful!
{any attributes not starting with $}Each attribute name specifies a field to be created in the new tiddler

Variables

Introduced in v5.2.0 The content of the $action-createtiddler widget is executed after the new tiddler has been created. The title of the newly created tiddler is stored in the variable createTiddler-title.

VariablesDescription
createTiddler-titleThe tittle of the tiddler that has been created. See ActionCreateTiddlerWidget Example 5
createTiddler-draftTitleThis variable only exists to have feature parity with the deprecated parameters. It contains the title of a "draft tiddler"

Examples

Create a new page control button

Use the $action-createtiddler widget to create and open a new, non-functional page control button tiddler

titleOutput

Caption for new button:

Default widget with no attributes

The button in this example uses the $action-createtiddler widget to create "New Tiddler", "New Tiddler 1", " New Tiddler 2" and so on

titleOutput

Transcluded base title

The $action-createtiddler widget in this example uses the base title defined in $:/language/DefaultNewTiddlerTitle.

It will overwrite the tiddler if the button is clicked several times.

titleOutput

Template and custom base title

The $action-createtiddler widget in this example uses the basetitle attribute and template: ActionCreateTiddlerWidget Template.

Clicking the button will create: "base", "base 1", "base 2" and so on

titleOutput

Template with override fields and custom base title

The $action-createtiddler widget in this example uses the basetitle attribute and template: ActionCreateTiddlerWidget Template.

There will be new fields "aa" and "bb" which are added to the new tiddlers.

titleOutput

Child action widget uses the created tiddler title

The $action-createtiddler widget in this example uses the createTiddler-title variable to navigate to the created tiddler

titleOutput