1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-28 12:29:56 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/variables/WidgetVariable_ transclusion.tid

46 lines
1.1 KiB
Plaintext
Raw Normal View History

2014-10-02 15:02:48 +00:00
caption: transclusion
created: 20141002004621385
2015-01-07 15:18:36 +00:00
modified: 20150107121000000
2014-10-02 15:02:48 +00:00
tags: Variables
title: WidgetVariable: transclusion
type: text/vnd.tiddlywiki
2015-01-07 15:18:36 +00:00
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.
2014-10-02 15:02:48 +00:00
2015-01-07 15:18:36 +00:00
With the ''transclusion'' variable, the QualifyMacro identifies the stack of transcluded tiddlers.
2014-10-02 15:02:48 +00:00
2015-01-07 15:18:36 +00:00
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''
2014-10-02 15:02:48 +00:00
```
\define mymacro()
2015-01-07 15:18:36 +00:00
We are
<$list
filter="[<transclusion>prefix[{|$:/core/ui/PageTemplate/sidebar|||}]]"
emptyMessage="in the story river.">
in the sidebar.
2014-10-02 15:02:48 +00:00
</$list>
\end
<<mymacro>>
```
2015-01-07 15:18:36 +00:00
Result in a story tiddler:
2014-10-02 15:02:48 +00:00
2015-01-07 15:18:36 +00:00
<<<
We are in the story river.
<<<
2014-10-02 15:02:48 +00:00
2015-01-07 15:18:36 +00:00
Result in the sidebar:
2014-10-02 15:02:48 +00:00
2015-01-07 15:18:36 +00:00
<<<
We are in the sidebar.
<<<