1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-29 11:30:28 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/widgets/DataWidget.tid
Mario Pietsch 165c7e9825
Data widget add compound filter parameter (#8447)
* add $compound-filter parameter to data-widget

* update TestCaseTemplate to use $compound-filter parameter

* update data-widget, TestCaseTiddlers and CompoundTiddlers docs
2024-07-29 12:19:44 +01:00

44 lines
2.6 KiB
Plaintext

caption: data
created: 20240507221902644
modified: 20240729084028713
tags: Widgets
title: DataWidget
type: text/vnd.tiddlywiki
! Introduction
The data widget is used with the <<.wlink TestCaseWidget>> widget and the [[Innerwiki Plugin]] to specify payload tiddlers that are to be included in the test case or innerwiki.
! Content and Attributes
The content of the data widget is ignored. It supports the following attributes:
|!Attribute |!Description |
|<<.attr $tiddler>> |Optional title of a tiddler to be used as a payload tiddler (optional) |
|<<.attr $filter>> |Optional filter string identifying tiddlers to be used as payload tiddlers (optional) |
|<<.attr $compound-tiddler>> |Optional title of a tiddler containing payload tiddlers in `text/vnd.tiddlywiki-multiple` format (see below) |
|<<.attr $compound-filter>> |<<.from-version "5.3.6">> Optional filter, to create a list of tiddlers that contain compound tiddlers. <<.infoBox """Tiddlers will be imported in order. Existing testcase tiddlers will be overwritten, so the currentTiddler wins""">>|
|//any attribute<br>not starting<br>with $// |Field values to be assigned to the payload tiddler(s) |
The data widget is not rendered when used within the <<.wlink TestCaseWidget>> widget or the [[Innerwiki Plugin]] but for ease of testing, when used elsewhere it renders a JSON representation of the payload tiddlers.
Without any of the attributes <<.attr $tiddler>>, <<.attr $filter>> or <<.attr $compound-tiddler>>, any attributes whose name does not start with $ are used as the field values for creating a single new tiddler.
<<testcase "TestCases/DataWidget/SimpleTiddler">>
If any of the attributes <<.attr $tiddler>>, <<.attr $filter>> or <<.attr $compound-tiddler>> are specified then they are used to generate base tiddlers that are then modified with the addition of fields derived from any attributes whose name does not start with $.
The attribute <<.attr $tiddler>> is used to ingest a single tiddler from the wiki containing the data widget:
<<testcase "TestCases/DataWidget/ImportedTiddler">>
The attribute <<.attr $filter>> is used to ingest multiple tiddlers from the wiki containing the data widget:
<<testcase "TestCases/DataWidget/ImportedFilter">>
! Compound Tiddlers
[[Compound tiddlers|CompoundTiddlers]] provide a way to easily create multiple tiddlers from within a single tiddler. They are contained in tiddlers of type `text/vnd.tiddlywiki-multiple`. The text field consists of a series of tiddlers in the same format as `.tid` files, each separated by a line containing a single `+` character.
<<testcase "TestCases/DataWidget/ImportCompound">>