2021년 10월 23일 오후 4:24
Introduction
The setmultiplevariables widget assigns values to multiple variables where the names and values of the variables are specified as separate filter.
Content and Attributes
The content of the <$setmultiplevariables>
widget is the scope for the value assigned to the variable.
Attribute | Description |
---|---|
$names | Filter evaluating to the names of a list of variables to assign |
$values | Filter evaluating to the values corresponding to the list of names specified in $names |
Examples
Here is an example of a convoluted way to display the values of the fields of the tiddler "HelloThere":
<$setmultiplevariables $names="[[HelloThere]fields[]addprefix[demo-]]" $values="[[HelloThere]fields[]] :map[[HelloThere]get<currentTiddler>]">
<ol>
<$list filter="[variables[]prefix[demo-]sort[]]">
<li>
''<$text text={{{ [<currentTiddler>removeprefix[demo-]] }}}/>'': <$text text={{{ [<currentTiddler>getvariable[]] }}}/>
</li>
</$list>
</ol>
</$setmultiplevariables>
That renders as:
- created: 20130822170200000
- icon: $:/core/icon
- list: [[A Gentle Guide to TiddlyWiki]] [[Discover TiddlyWiki]] [[Some of the things you can do with TiddlyWiki]] [[Ten reasons to switch to TiddlyWiki]] Examples [[What happened to the original TiddlyWiki?]]
- modified: 20241115170824144
- tags: Welcome
- text: <h2 style=" background: red; padding: 0.5em; color: white; font-weight: bold; text-align: center; border-radius: 0.5em; box-shadow: 0 1px 3px 0 #d4d4d5, 0 0 0 1px #d4d4d5; background-image: linear-gradient(90deg, rgb(224, 63, 34), rgb(255, 133, 133), rgb(224, 63, 34)); "> Make More of Your Notes with ~TiddlyWiki </h2> <h2 class="tc-hero-heading" style=" text-align: center; "> ''Welcome to TiddlyWiki, a unique [[non-linear|Philosophy of Tiddlers]] notebook for [[capturing|Creating and editing tiddlers]], [[organising|Structuring TiddlyWiki]] and [[sharing|Sharing your tiddlers with others]] complex information'' </h2> Use it to keep your [[to-do list|TaskManagementExample]], to plan an [[essay or novel|"TiddlyWiki for Scholars" by Alberto Molina]], or to organise your wedding. Record every thought that crosses your brain, or build a flexible and responsive website. * ~TiddlyWiki stores its data and code in a single HTML file, requiring no installs, no external dependencies, just a web browser * ~TiddlyWiki lets you choose where to keep your data, guaranteeing that in the decades to come you will [[still be able to use|Future Proof]] the notes you take today * ~TiddlyWiki is infinitely customisable and extensible with many plugins that add new features * ~TiddlyWiki is the product of a collective of developers, part of an extensive community of users
- title: HelloThere
- type: text/vnd.tiddlywiki