mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-04-30 20:16:43 +00:00
Overhaul the macro and variable documentation #1519
This commit is contained in:
@@ -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">>
|
||||
|
||||
Reference in New Issue
Block a user