mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-29 11:30:28 +00:00
a9c4f113a1
* Made the link between "names" and "properties" explicit (I only figured it out by reading the TextReference documentation) * Documented named property manipulation through ActionWidgets.
34 lines
1.3 KiB
Plaintext
34 lines
1.3 KiB
Plaintext
created: 201308291647
|
|
modified: 201308291647
|
|
tags: Concepts
|
|
title: DataTiddlers
|
|
|
|
A data tiddler is a miniature database contained within a tiddler.
|
|
|
|
There are two standard formats:
|
|
|
|
* DictionaryTiddlers
|
|
* [[JSONTiddlers]]
|
|
|
|
Other formats of tiddler can also be parsed to yield blocks of data that behave like data tiddlers.
|
|
|
|
Use a TextReference to look up the value of a named property. For example, if a [[DictionaryTiddler|DictionaryTiddlers]] called `MonthDays` contains:
|
|
|
|
```
|
|
oct:31
|
|
nov:30
|
|
dec:31
|
|
```
|
|
|
|
... then `{{MonthDays##nov}}` will resolve to the value `30`.
|
|
|
|
The same is true if `MonthDays` is a [[JSONTiddler|JSONTiddlers]] with the following content:
|
|
|
|
```
|
|
{"oct":31,"nov":30,"dec":31}
|
|
```
|
|
|
|
Note: //It is currently only possible to retrieve data from the immediate properties of the root object of a JSONTiddler.//
|
|
|
|
The widgets ActionSetFieldWidget and ActionListopsWidget can manipulate named properties of data tiddlers by indicating the name of the property in the $index attribute. To create or modify a named property with ActionSetFieldWidget, provide a $value attribute. To delete a named property with ActionSetFieldWidget, omit the $value attribute. ActionListopsWidget assigns the named property the list constructed through its $filter and $subfilter attributes.
|