This is a stripped-down version of a single section of Grok TiddlyWiki, optimized for fast loading and readability by search engines. Some features are missing.

For the full Grok TiddlyWiki experience, please visit the wiki version of this page.

Wr:Transclusions

20th March 2021 at 2:00pm

Transclusions of fields, macros, and variables are an essential part of TiddlyWiki. Here's the standard syntax for including bits and pieces from other tiddlers in this tiddler.

See Summary of Macro and Transclusion Syntax for a more detailed treatment.

Transclude the text field of a tiddler

{{Sn:IncludeMe}}
{{Sn:IncludeMe!!text}}

Here is some text to be transcluded.

Here is some text to be transcluded.

Transclude a specific field of a tiddler, here caption

{{Sn:IncludeMe!!caption}}

Include me please!

Transclude an index from a data tiddler (The Metadata tiddler contains details about Grok TiddlyWiki like its version number and project URL.)

//Grok TiddlyWiki// version {{Metadata##version}}

Grok TiddlyWiki version 1.2.2

Transclude a tiddler through a template

{{Sn:IncludeMe||Sn:BoldfaceTemplate}}

Here is some text to be transcluded.

Transclude the current tiddler through a template

{{||Sn:CaptionFieldTemplate}}

The caption of the current tiddler is “Transclude the current tiddler through a template”.

Transclude the result of a filter

{{{ [all[tiddlers+shadows]!is[system]tag[Template]] }}}

Transclude the result of a filter through a template

{{{ [all[tiddlers+shadows]tag[Exercise]first[]] || Sn:BoldfaceTemplate }}}

Place the ContactInformationTemplate on all of the contacts in your wiki.

(You may be wondering if there's a way to avoid even the repetition of adding the reference to the template to all your tiddlers. The answer is yes, and we'll be getting there in a couple chapters.)

Transclude the value of a variable

<$set name="myvariable" value="Hello!">
  <<myvariable>>
</$set>

Hello!

Call a macro (transcluding its result), treating its parameter as a variable

\define mymacro(myName) Hi <<__myName__>>!

<<mymacro Soren>>

Hi Soren!

Call a macro (transcluding its result), using its parameter in text substitution

\define mymacro(myName) Hi $myName$!

<<mymacro Soren>>

Hi Soren!

Transclude the value of a variable in a macro via text substitution

\define wikipediaLink() https://en.wikipedia.org/wiki/$(articleName)$

<$set name="articleName" value="TiddlyWiki">
  <<wikipediaLink>>
</$set>