mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-26 18:10:27 +00:00
f0bd06b38d
* Added macros for displaying wikitext examples in a table * Added documentation for WikiText parsing * Changed recognize to British spelling * Add links to the new wikitext parser tiddlers
52 lines
1.7 KiB
Plaintext
52 lines
1.7 KiB
Plaintext
caption: Transclusion
|
|
created: 20131205160146648
|
|
modified: 20220122193352028
|
|
tags: WikiText
|
|
title: Transclusion in WikiText
|
|
type: text/vnd.tiddlywiki
|
|
|
|
! Introduction
|
|
|
|
You can incorporate the content of one tiddler within another using the [[Transclusion]] notation:
|
|
|
|
* `{{MyTiddler}}` transcludes a single tiddler
|
|
* `{{MyTiddler||TemplateTitle}}` displays the tiddler through a specified [[TemplateTiddler|TemplateTiddlers]]
|
|
* `{{||TemplateTitle}}` displays the specified template tiddler without altering the [[current tiddler|Current Tiddler]]
|
|
|
|
!! Transcluding Text References
|
|
|
|
You can also use a TextReference instead of a tiddler title:
|
|
|
|
* `{{MyTiddler!!field}}` transcludes a specified field of a tiddler
|
|
* `{{!!field}}` transcludes a specified field of the current tiddler
|
|
* `{{MyTiddler##index}}` transcludes a specified indexed property of a [[DataTiddler|DataTiddlers]]
|
|
* `{{##index}}` transcludes a specified indexed property of the current [[DataTiddler|DataTiddlers]]
|
|
|
|
!! Filtered Transclusion
|
|
|
|
A similar syntax can be used to transclude a list of tiddlers matching a specified [[filter|Filters]]:
|
|
|
|
```
|
|
{{{ [tag[mechanism]] }}}
|
|
{{{ [tag[mechanism]] ||TemplateTitle}}}
|
|
```
|
|
|
|
! Generated Widgets
|
|
|
|
The WikiText transclusion syntax generates a TiddlerWidget wrapped around a TranscludeWidget. For example, `{{MyTiddler||MyTemplate!!myField}}` generates the following pair of widgets:
|
|
|
|
```
|
|
<$tiddler tiddler="MyTiddler">
|
|
<$transclude tiddler="MyTemplate" field="myField"/>
|
|
</$tiddler>
|
|
```
|
|
|
|
See also:
|
|
|
|
* [[Transclusion Basic Usage]]
|
|
* [[Transclusion with Templates]]
|
|
* TemplateTiddlers
|
|
* TranscludeWidget
|
|
* [[Transclusion and Substitution]]
|
|
* [[WikiText parser mode: transclusion examples]]
|