1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-13 21:34:51 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/variables/WidgetVariable_ transclusion.tid

37 lines
1.0 KiB
Plaintext
Raw Normal View History

2014-10-02 15:02:48 +00:00
caption: transclusion
created: 20141002004621385
2014-10-02 23:15:06 +00:00
modified: 20141002162057822
2014-10-02 15:02:48 +00:00
tags: Variables
title: WidgetVariable: transclusion
type: text/vnd.tiddlywiki
2014-10-02 23:15:06 +00:00
! Mechanism
2014-10-02 15:02:48 +00:00
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.
2014-10-02 23:15:06 +00:00
! Example
2014-10-02 15:02:48 +00:00
```
\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
```