TiddlyWiki

TiddlyWiki

19 bookmarks
Custom sorting
Grok TiddlyWiki — Templates
Grok TiddlyWiki — Templates
To make the ContactInformationTemplate work the way we want, we need a way of not changing the current tiddler during a field transclusion, or, more generally, making the current tiddler a tiddler of our choice during the transclusion. This is called transcluding a tiddler through a template. The syntax is {{tiddler||template}}. So here it would be: {{JaneDoe||ContactInformationTemplate}} Add that in the JaneDoe tiddler in place of plain {{ContactInformationTemplate}}, and you should immediately see Jane's information show up again, because we told TiddlyWiki to transclude ContactInformationTemplate, but to make the current tiddler during the transclusion be JaneDoe, rather than ContactInformationTemplate. Sweet!
the syntax for templates uses two consecutive pipe characters (||).
Since templates are usually written expecting the current tiddler to be some other tiddler – not the template tiddler itself – when you look at a template tiddler directly, it may look pretty funny. For instance, there will likely be some data missing. The formatting may even be incorrect, or TiddlyWiki may show an outright error (e.g., a Recursive transclusion error). This should not worry you. In general, the only way to know if a template tiddler is written correctly is to actually use it as a template and see if the expected output appears there.
·groktiddlywiki.com·
Grok TiddlyWiki — Templates