21st March 2023 at 1:04pm
A TextReference is a general purpose way to describe a fragment of text as either a field of a tiddler, or an index within a data tiddler.
In different situations, text references can be used to retrieve values, or to specify a value that should be modified.
A TextReference consists of several parts:
- The title of the target tiddler. If omitted, it defaults to the Current Tiddler
- Either one of:
- The name of a field (marked with
!!
) - The name of an index within a data tiddler (marked with
##
)
- The name of a field (marked with
- If both the field and index are omitted, the text field is used as the default
Most of the parts of a text reference can be optional:
tiddlerTitle
- the title field of the specified tiddlertiddlerTitle!!field
- a tiddler field (eg,modified
,modifier
,type
etc)!!field
- a field of the current tiddlertiddlerTitle##propertyIndex
- extracts a named property from DataTiddlers
Text references can be used in several places:
- As indirect parameters within Filters (eg,
<$list filter="[tag{MyTag!!name}]"/>
) - As indirect attributes of an element or widget (eg,
<$widget attrib={{Title!!description}}/>
) - As the parameter of a shortcut transclusion (eg,
{{MyTiddler!!title}}
) - As the
state
attribute of the RevealWidget and the LinkCatcherWidget