We learned about a lot of different ways of reusing and relating content in TiddlyWiki in this chapter, and when you've just learned all of them, it's often difficult to keep them straight. Let's review all the options and the syntax for each.
We'll be adding a handful of new tools to our toolbox in chapters 5 and 6, so we'll have an updated version, Updated Summary of Transclusion Syntax, at the end of chapter 6. You can also find a condensed version 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.
{{curly braces}}
- To transclude the value of a field of a tiddler.
{{tiddler}}
to transclude thetext
field of a tiddler{{tiddler!!field}}
to transclude a different field of a 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