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.

Updated Summary of Transclusion Syntax

 10th October 2024 at 8:00am

At the end of chapter 4, we threw together a Summary of Transclusion Syntax. Since then, we've added functions, macros, and data tiddlers, so there's a little more syntax to add. Here's an updated version.

You can find a condensed version of this section in the Wikitext Reference, which also has some live examples you can play with.

Available in wikitext, attribute values, and filter expressions

The following types of references work within wikitext, as the values of HTML or widget attributes, and within filter expressions. In filter expressions, you use only one of each type of bracket. In wikitext and attribute values, you use two.

[[square brackets]]
To link or refer to the title of a tiddler.
<<angle brackets>>
To get the value of a variable or call a procedure, function, or macro.
{{curly braces}}
To transclude the value of a field of a tiddler.

  • {{tiddler}} to transclude the text field of a tiddler
  • {{tiddler!!field}} to transclude a different field of a tiddler
  • {{tiddler##index}} to transclude a property of a data tiddler
  • {{!!field}} to transclude a field of the current tiddler
  • {{tiddler||Template}} to transclude a tiddler through a template
  • {{||Template}} to transclude the current tiddler through a template
  • {{tiddler|param1|param2|...}} to transclude a tiddler with parameters (optionally with either !! or || syntax before the first | to transclude an arbitrary field or perform a template transclusion, respectively)

Available only within wikitext and attribute values

{{{ triple curly braces }}}
To select one or more tiddlers using a filter, then transclude them. You can think of this as the “super” or “extra powerful” version of normal double-brace transclusion, since it has one extra brace.

This form is not available inside another filter expression; if you need to nest filter expressions this way, store the results of the inner filter expression in a variable and then transclude the value of that variable into the outer filter expression.

Available only within attribute values

Backticks can be used to combine constant text and variables and/or the results of filter expressions into a single attribute of a widget or HTML element.

<$widget attribute=`text with a $(variable)$ in it`/>
To combine constant text and one or more variables (in $(these thingies)$) into the value of an attribute
<$widget attribute=`text with a ${ [[filter expression]] } in it`/>
To combine constant text and the result of one or more filter expressions (in ${ these thingies }$ into the value of an attribute

Available only within macros

Macros have special syntax to perform direct text substitution.

  • <<angle brackets>> refer to a variable without text substitution. (This is the same standard syntax available outside a macro and is included here for comparison with the following three items.)
  • <<__angle brackets with underscores__>> refer to a parameter of the macro without text substitution. (In a procedure, you would just use normal <<angle brackets>>.) Inside a filter expression, use <__single angle brackets but double underscores__>.
  • $(parenthesized dollar signs)$ refer to a variable using text substitution.
  • $dollar signs$ refer to a parameter of the macro using text substitution.

Neither the <<variable>> nor the <<__parameter__>> syntax works if the contents of your macro will not be wikified where you intend to call it – just as it doesn't work in a procedure.

↑ 6: Macros, Wikification, and Widgets