help on filter and enlist

48 views
Skip to first unread message

Laurent Bonet

unread,
Oct 6, 2018, 5:16:07 AM10/6/18
to TiddlyWiki
Hello,

Would like to get help on how to write a filter which include enlist.
I want to filter a list which is contained in field called validity (see attached screenshot).
with filter="[enlist{!!validity}title[B]" everything is fine I'm getting a B value.
with filter="[enlist{!!validity}title[X]]" I was hoping to get nothing as X is not part of "A B C" but I'm getting the X value...

Thanks in advance for your help.

Capture d’écran 2018-10-06 à 11.15.23.png

 


Jed Carty

unread,
Oct 6, 2018, 5:49:03 AM10/6/18
to TiddlyWiki
The problem is that title in your filter is a construction operator (https://tiddlywiki.com/#Selection%20Constructors)

If the things listed are tiddlers than you can use field:title[X] and it will work the way you expect, but only if there is a tiddler called X.

If the list isn't just titles of tiddlers that exist than to do what you want to do you can use prefix or suffix like this:

<$list filter='[enlist{!!validity}prefix[X]]'>

</$list>

Of course this isn't perfect because it will match anything that has the title as a prefix. You can combine prefix and suffix to be a bit safer but it is also not prefect

[enlist{!!validity}prefix[X]suffix[X]]

Laurent Bonet

unread,
Oct 6, 2018, 6:00:45 AM10/6/18
to TiddlyWiki
Perfect. Thanks so much for the reactivity and the clarity of the answer!
Reply all
Reply to author
Forward
0 new messages