mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-28 04:19:56 +00:00
46 lines
1.1 KiB
Plaintext
46 lines
1.1 KiB
Plaintext
caption: transclusion
|
|
created: 20141002004621385
|
|
modified: 20150107121000000
|
|
tags: Variables
|
|
title: WidgetVariable: transclusion
|
|
type: text/vnd.tiddlywiki
|
|
|
|
The ''transclusion'' [[variable|Variables]] is automatically set by the TranscludeWidget to contain a string identifying the position of the current node within the widget tree.
|
|
|
|
With the ''transclusion'' variable, the QualifyMacro identifies the stack of transcluded tiddlers.
|
|
|
|
In the sidebar, the ''transclusion'' variable is set to:<br>
|
|
`{|$:/core/ui/PageTemplate/sidebar|||}`
|
|
|
|
When the tiddler "HelloThere" is displayed in the story river ''transclusion'' is set to:<br> `{HelloThere|HelloThere|||}`
|
|
|
|
Each nested level of transclusion appends another curly bracketed list of symbols.
|
|
|
|
!! Example
|
|
|
|
''identifying if we're in the sidebar or not''
|
|
|
|
```
|
|
\define mymacro()
|
|
We are
|
|
<$list
|
|
filter="[<transclusion>prefix[{|$:/core/ui/PageTemplate/sidebar|||}]]"
|
|
emptyMessage="in the story river.">
|
|
in the sidebar.
|
|
</$list>
|
|
\end
|
|
|
|
<<mymacro>>
|
|
```
|
|
|
|
Result in a story tiddler:
|
|
|
|
<<<
|
|
We are in the story river.
|
|
<<<
|
|
|
|
Result in the sidebar:
|
|
|
|
<<<
|
|
We are in the sidebar.
|
|
<<< |