2022-05-02 09:00:50 +00:00
|
|
|
title: Transclude/Parameterised/Name/Values
|
|
|
|
description: Parameterised transclusion accessing parameters as name/value pairs
|
|
|
|
type: text/vnd.tiddlywiki-multiple
|
|
|
|
tags: [[$:/tags/wiki-test-spec]]
|
|
|
|
|
|
|
|
title: Output
|
|
|
|
|
|
|
|
\whitespace trim
|
2022-05-05 07:20:14 +00:00
|
|
|
<$transclude $tiddler="TiddlerOne" 0="" 1="" 2=""/>
|
|
|
|
|
2022-05-02 09:00:50 +00:00
|
|
|
{{TiddlerOne}}
|
|
|
|
{{TiddlerOne|Ferret}}
|
|
|
|
{{TiddlerOne|Butterfly|Moth}}
|
|
|
|
{{TiddlerOne|Beetle|Scorpion|Snake}}
|
|
|
|
{{TiddlerOne||TiddlerTwo|Beetle|Scorpion|Snake}}
|
2022-05-03 15:53:00 +00:00
|
|
|
+
|
2022-05-02 09:00:50 +00:00
|
|
|
title: TiddlerOne
|
|
|
|
|
|
|
|
\whitespace trim
|
|
|
|
\parameters(zero:'Jaguar',one:'Lizard',two:'Mole')
|
|
|
|
<$list filter="[enlist<paramNames>]" counter="counter">
|
2022-05-05 07:20:14 +00:00
|
|
|
{<$text text={{{ [enlist:raw<paramNames>nth<counter>] }}}/>:<$text text={{{ [enlist:raw<paramValues>nth<counter>] }}}/>}
|
2022-05-02 09:00:50 +00:00
|
|
|
</$list>
|
2022-05-03 15:53:00 +00:00
|
|
|
+
|
2022-05-02 09:00:50 +00:00
|
|
|
title: TiddlerTwo
|
|
|
|
|
|
|
|
\whitespace trim
|
|
|
|
\parameters(zero:'Mouse',one:'Horse',two:'Owl')
|
|
|
|
(<$transclude $tiddler=<<currentTiddler>> zero=<<zero>> one=<<one>> two=<<two>>/>)
|
2022-05-03 15:53:00 +00:00
|
|
|
+
|
2022-05-02 09:00:50 +00:00
|
|
|
title: ExpectedResult
|
|
|
|
|
2022-05-05 07:20:14 +00:00
|
|
|
<p>{0:}{1:}{2:}</p><p></p><p>{0:Ferret}</p><p>{0:Butterfly}{1:Moth}</p><p>{0:Beetle}{1:Scorpion}{2:Snake}</p><p>({zero:Beetle}{one:Scorpion}{two:Snake})</p>
|