add WidgetVariable documentation

This commit is contained in:
Eucaly
2014-10-02 23:02:48 +08:00
parent 459133cc57
commit d9ccac21d0
6 changed files with 107 additions and 1 deletions

View File

@@ -0,0 +1,35 @@
caption: transclusion
created: 20141002004621385
modified: 20141002133923307
tags: Variables
title: WidgetVariable: transclusion
type: text/vnd.tiddlywiki
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:
```
\define mymacro()
Hello from mymacro
<$list filter="[<transclusion>prefix[{|$:/core/ui/PageTemplate/sidebar|||}]]" emptyMessage="in a tiddler">
in the sidebar
</$list>
\end
<<mymacro>>
```
Result in story tiddler
```
Hello from mymacro in a tiddler
```
Result in the sidebar
```
Hello from mymacro in the sidebar
```