I’m trying to handle a certain subset of missing tiddlers with a ViewTemplateBodyFilter. I have successfully done so before with something like this:
title: $:/_/bb/config/ViewTemplateBodyFilters/card
tags: $:/tags/ViewTemplateBodyFilter
[prefix[Card_]then[$:/_/bb/templates/bingo-card]]
title: $:/_/bb/templates/bingo-card
<$let card={{{ [<currentTiddler>removeprefix[Card_]] }}}>
<!-- build my interface using `card` -->
</$let>
But that used the title as the input to the filter run. The way I know to do this for my current project would require the title elsewhere in the filter. What I’m trying looks like this:
Warning: broken code!
title: $:/_/sql/config/ViewTemplateBodyFilters/country tags: $:/tags/ViewTemplateBodyFilter [all.countries[]match<currentTiddler>then[$:/_/sql/templates/Country]] <!-- ^^^^^^^^^^^^^^ -->
I was assuming that the title would be passed as currentTiddler
. But it’s not happening. Or something else is going wrong. Is there a straightforward way to rewrite this filter?
Note that all.countries
is collecting a list of countries known elsewhere in the wiki:
\function all.countries() [tag[Customer]get[country]] [tag[Supplier]get[country]] +[unique[]sort[]]
That’s working properly.
<$list filter="France Brazil Ecuador Russia USA" >
<li>{{{ [all.countries[]match<currentTiddler>then[yes]else[no]] }}}</li>
</$list>
properly returns yes, yes, no, no, yes
.
I’m pretty sure that this means that my hope/assumption – that currentTiddler
would include the title of the missing tiddler – is simply wrong.
Can you suggest another way I can write this cascade step?