I have a case to build a dynamic filter from several independ filter runs. Some uses :then
. I do it employing functions like below.
Before TW 5.2.0 I did this kind of filter building using macro and strings.
Example:
\function links.filter() [<tidlinks>match[yes]] :then[<currentTiddler>links[]]
\function backlinks.filter() [<tidbacklinks>match[yes]] :then[<currentTiddler>backlinks[]]
\function main.filter()
[function[links.filter]]
[function[backlinks.filter]]
\end
<!-- change options here to yes, or no -->
<$let tidlinks="yes" tidbacklinks="no" currentTiddler="HelloThere" >
* One: <$count filter="[[HelloThere]links[]]"/> <!-- for comparison only -->
* Two: <$count filter="[[HelloThere]backlinks[]]"/>
Compound filter:
* <$count filter="[function[main.filter]]"/>
</$let>
We know we cannot use several :then
in one expression in the above example, as each :then
will ignore the inputs.
Is this the correct way? What do you think? and what is your solution here?