Overhaul the macro and variable documentation #1519

This commit is contained in:
Jermolene
2015-02-24 17:41:16 +01:00
parent fdc635007b
commit b13d87fdf2
138 changed files with 1320 additions and 754 deletions

View File

@@ -1,41 +1,14 @@
caption: currentTiddler
created: 20141001232824187
modified: 20150107121000000
tags: Variables
title: WidgetVariable: currentTiddler
modified: 20150221152029000
tags: Variables [[Core Variables]]
title: currentTiddler Variable
type: text/vnd.tiddlywiki
The ''currentTiddler'' [[variable|Variables]] contains the title of the current tiddler.
The <<.def currentTiddler>> [[variable|Variables]] contains the title of the [[current tiddler|Current Tiddler]].
!! Usage
Several aspects of WikiText use this tiddler as their context. As a result, within a <<.wlink ListWidget>> widget or a [[template tiddler|TemplateTiddlers]], there is often no need to explicitly specify a tiddler title.
Various [[Widgets]] and [[Macros]] are by default applied with respect to the tiddler referenced via ''currentTiddler''. Within the [[ListWidget]] or TemplateTiddlers you are thus often not required to specify the tiddler title.
Compare <<.vlink storyTiddler>>.
The following two examples are thus equivalent...
* `<$view field=title/>`
* `<$view field=title tiddler=<<currentTiddler>>/>`
;TranscludeWidget
: when [[transcluding|Transclusion]] a tiddler, ''currentTiddler'' is set to the tiddler being transcluded,
: e.g. when using the [[WikiText shorthand|Transclusion in WikiText]]: `{{||TemplateTiddlerTitle}}`
; ListWidget
: overrides the ''currentTiddler'' variable with the currently iterated list-item,
: unless a custom `variable` attribute is specified
; TiddlerWidget
: sets the ''currentTiddler'' variable for its inner scope
!! Example
```
<$view tiddler=<<currentTiddler>> field=title/>
```
<<<
<$view tiddler=<<currentTiddler>> field=title/>
<<<
!! Other Standard Variables
* [[WidgetVariable: storyTiddler]]
* [[WidgetVariable: transclusion]]
<<.variable-examples "currentTiddler">>