[tw5] Parameterized transclusions

When dealing with many parameters, I’m likely to setup a macro.

If things aren’t too complicated, I much prefer transclusion and transclusion templates.

Why? I can’t explain it. Macros annoy me for whatever reason.

Although a silly scenario, this sample code is about a little bit of filtering fun and to showcase how simple transclusion can be used for all sorts of things that are a little on the far side.

I’ve got a tiddler called “Some Tiddler” that has the text “Text in Some Tiddler”

I’ve got another tiddler with the following text:

{{Some Tiddler::red||tColouredText}}

{{Some Tiddler::green||tColouredText}}

{{Some Tiddler::blue||tColouredText}}

The template tiddler “tColouredText” has this text:

<$list filter="[!match[tColouredText]]">
<$vars thisTiddler={{{ [split[::]nth[1]] }}}
thisColour={{{ [split[::]nth[2]else[black]] }}}>

<div style={{{ [[color:]addsuffixaddsuffix[;]] }}}> <$transclude tiddler=<>/>