1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-07-03 02:33:15 +00:00
TiddlyWiki5/editions/prerelease/tiddlers/ActionSetFieldWidget.tid

34 lines
1.4 KiB
Plaintext
Raw Normal View History

2014-11-06 18:06:47 +00:00
caption: action-setfield
created: 20141025120850184
modified: 20141106173455527
tags: Widgets ActionWidgets
title: ActionSetFieldWidget
type: text/vnd.tiddlywiki
! Introduction
The ''action-setfield'' widget is an [[action widget|ActionWidgets]] that assigns a value to a specified field of a tiddler. ActionWidgets are used within triggering widgets such as the ButtonWidget.
2014-11-06 18:37:08 +00:00
See also the ActionSetFieldsWidget (note the extra "s") that provides a way to set the values of multiple fields in a single operation.
2014-11-06 18:06:47 +00:00
! Content and Attributes
The ''action-setfield'' widget is invisible. Any content within it is ignored.
|!Attribute |!Description |
|$tiddler |The title of the tiddler whose fields are to be modified (if not provided defaults to the [[WidgetVariable: currentTiddler]] |
|$field |The name of the field to be modified. If neither a field or index is specified, then the default field "text" is used |
|$index |If $field is not provided, specifies the index of a [[data tiddler|DataTiddlers]] to modify |
|$value |The value to be assigned to the field or index |
! Examples
Here is an example of a button that opens the control panel directly to the "Appearance" tabs:
<$macrocall $name='wikitext-example-without-html'
src='<$button>
<$action-setfield $tiddler="$:/state/tab-1749438307" $field="text" $value="$:/core/ui/ControlPanel/Appearance"/>
<$action-navigate $to="$:/ControlPanel"/>
Go to Control Panel "Appearance" tab
</$button>'/>