Filtered transclusions and parameters - bug/feature/easy fix?

As you may be aware we can now pass parameters in a transclusion Transclusion in WikiText

  • eg; {{MyTiddler||TemplateTitle|Parameter|SecondParameter}}

You may also be aware we can use the triple curly braces “filtered transclusions” to also transclude a template but with the tiddler(s) determined by a filter.

  • {{{ [<thisTiddler>]||template}}}

However the provision of parameters does not work, although they are visible in the widget tree.

  • {{{ [<thisTiddler>]||template|p1}}} fails with {}
    • if the template produces a result, as long as you provide a parameter it will be wrapped with {...}
  • I believe this is the position of a bug, if we fix this then “Filtered transclusions and parameters” will be possible.

How do I know this?
If you use a filtered transclusion such as {{{MyTiddler||TemplateTitle|p1}}} with a parameter to transclude a tiddler containing the following;

<$parameters $params=params >
<<params>>
</$parameters>

The result will be { {"0":"p1"} } - the parameters wrapped inside the unwanted { ... }

  • That is the paramater(s) in a filtered transclusion are available, only we get these unwanted curly braces.

What can we do now?

  • Someone else may be able to raise an issue that more directly addresses the bug.
  • Otherwise I can do so.

See Fix 7701 filtered transclusion fails if "}" follows somewhere in the text by pmario · Pull Request #7822 · Jermolene/TiddlyWiki5 · GitHub

I assume this is the same issue however in that GitHub fix it shows

{{{ [tag[docs]] |variablename||TemplateTitle}}}

when the current format is

{{{ [tag[docs]] ||TemplateTitle |variablename}}}
1 Like