mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-11 09:50:27 +00:00
update WidgetVariable documentation
This commit is contained in:
parent
d9ccac21d0
commit
52a2d5ade2
@ -1,5 +1,5 @@
|
||||
created: 20141002133113496
|
||||
modified: 20141002142932824
|
||||
modified: 20141002230631361
|
||||
tags: Reference
|
||||
title: Variables
|
||||
type: text/vnd.tiddlywiki
|
||||
@ -10,4 +10,6 @@ You can define your own [[Variables in WikiText]] or use built-in variables.
|
||||
|
||||
More detailed information of built-in variables could be found in below:
|
||||
|
||||
<<list-links "[tag[Variables]]">>
|
||||
<<list-links "[tag[Variables]]">>
|
||||
|
||||
See also DumpVariablesMacro
|
@ -1,11 +1,12 @@
|
||||
caption: currentTiddler
|
||||
created: 20141001232824187
|
||||
modified: 20141002133837818
|
||||
modified: 20141002161518301
|
||||
tags: Variables
|
||||
title: WidgetVariable: currentTiddler
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<<
|
||||
! Mechanism
|
||||
|
||||
The ''currentTiddler'' variable containes the title of the current tiddler.
|
||||
|
||||
The ListWidget assigns the list result to the ''currentTiddler'' variable, unless the `variable` attribute is specified.
|
||||
@ -13,7 +14,8 @@ The ListWidget assigns the list result to the ''currentTiddler'' variable, unles
|
||||
A couple of [[Widgets]] and [[Macros]] by default apply to the tiddler according to the ''currentTiddler'' variable.
|
||||
|
||||
The TranscludeWidget (or WikiText `{{||TemplateTitle}}`) transcludes a tiddler without changing the ''currentTiddler'' variable.
|
||||
<<<
|
||||
|
||||
! Using currentTiddler Variable
|
||||
|
||||
These mechanisms together allow you to write references like `<$view field="title" format="link"/>` in TemplateTiddlers or inside the ListWidget hierarchy without explicitly specifying the tiddler that it applies to.
|
||||
|
||||
|
@ -1,15 +1,16 @@
|
||||
caption: transclusion
|
||||
created: 20141002004621385
|
||||
modified: 20141002133923307
|
||||
modified: 20141002162057822
|
||||
tags: Variables
|
||||
title: WidgetVariable: transclusion
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
! Mechanism
|
||||
The ''transclusion'' variable is set automatically by the transclude widget to contain a string that identifies the position of the current node within the widget tree. In the sidebar it is set to `{|$:/core/ui/PageTemplate/sidebar|||}` and within the tiddler "HelloThere" in the story river it is set to `{HelloThere|HelloThere|||}`. Each nested level of transclusion appends another curly bracketed list of symbols.
|
||||
|
||||
The QualifyMacro uses the ''transclusion'' variable to identify the stack of transcluded tiddlers.
|
||||
|
||||
! Example:
|
||||
! Example
|
||||
|
||||
```
|
||||
\define mymacro()
|
||||
|
@ -1,11 +1,11 @@
|
||||
caption: Variables
|
||||
created: 20141002141231992
|
||||
modified: 20141002144153170
|
||||
modified: 20141002230751664
|
||||
tags: WikiText
|
||||
title: Variables in WikiText
|
||||
type: text/vnd.tiddlywiki
|
||||
caption: Hard Linebreaks
|
||||
! Defining Variables
|
||||
|
||||
! Defining Variables
|
||||
Variables contains values defined by [[Widgets]].
|
||||
Variables are available within the widget that defines them, and the child widgets in the widget tree.
|
||||
|
||||
@ -18,10 +18,11 @@ Variables are defined by:
|
||||
|
||||
! Using Variables
|
||||
|
||||
Variables are used with:
|
||||
Variables are used in:
|
||||
|
||||
* Variable substitution `$(name)$`
|
||||
* Concise shortcut `<<name>>`
|
||||
* [[Filter expression|Introduction to Filters]] `[operator<variable-operand>]`
|
||||
* Some default behaviors of [[Widgets]]
|
||||
|
||||
Built-in [[variables|Variables]] are useful for dynamic WikiText.
|
||||
See also [[currentTiddler|WidgetVariable: currentTiddler]] variable and built-in [[variables|Variables]].
|
Loading…
Reference in New Issue
Block a user