Filter questions

Hi @TW_Tones ,

Thank you so much for the thoughtful and quite comprehensive reply! Sorry it took me a long time to reply.

Could you give a more complete example of that?

I didn’t know that. Cool!

Hmm, would you mind showing both the legacy and new way in more complete contexts?

Would you also mind commenting on this: Filter questions - #13 by Surge and Filter questions - #14 by Surge. I have some nerve! Or to quote a character from Salterton Trilogy: the cheek, the cheek he has!

  • I commonly use a config tiddler $:/config/design-mode which I set to yes or no.
  • Then I place some code I want to appear only when design-mode is yes.
<$list filter=[{$:/config/design-mode}match[yes]]">
   do this
</$list>
  • This has been a feature for some time, but macros such as “now” could not be used and not include parameters. So no real legacy.
  • Just try using the triple curly braces around any filter you are experimenting to get and idea how it works.
  • I will look now :nerd_face:

Perhaps a new thread with a more detailed explanation of what result you are after. When you ask for an intermediate result like “turn those into variables” it just makes it harder to understand your question and limits the possible answers we may give you.

Unfortunately, filter operator suffix values (e.g., :tags and :some) cannot be replaced with variables… unless the filter syntax is part of a macro definition. In that case, you can define the variables OUTSIDE the macro, and then use the $(varname)$ “macro substitution syntax” WITHIN the macro, like this:

\define showlist()
<$list filter="[kin:tags:to::{!!tag1}search:tags:$(x)${!!search}]">
<$link to=<<currentTiddler>>/>
<br/>
</$list>
\end

<$let x="some">
<<showlist>>
</$let>
1 Like

Thank you Eric, that’s actually exactly what I ended up doing. Thank you!