filter question

60 views
Skip to first unread message

James Anderson

unread,
Apr 11, 2021, 4:33:14 PM4/11/21
to TiddlyWiki
Hello,

Probably quite a basic filter question:  I have a tiddler named "a" with this expression in it:

<$list filter="[tag[example]contains:rei[a]]"><$transclude tiddler={{!!title}} mode=block/></$list>

And a couple of other tiddlers tagged "example" with a "rei" field that contains "a" and a few other entries. 

This works as I would expect and the matching tiddlers are transcluded in tiddler "a", I would like to change this expression to something like these:

<$list filter="[tag[example]contains:rei[!!title]]"><$transclude tiddler={{!!title}} mode=block/></$list>
or 
<$list filter="[tag[example]contains:rei{{!!title}}]"><$transclude tiddler={{!!title}} mode=block/></$list>

So that I can transclude based on the field rei when it contains the title of the current tiddler but neither of these work. what is the correct syntax? is this possible?

Also on a separate note is there a partial match filter. so I can find a partial match within a list or in a title e.g. wiki would match tiddlywiki

Thanks,
James


Mark S.

unread,
Apr 11, 2021, 4:40:25 PM4/11/21
to TiddlyWiki
Try:

<$list filter="[tag[example]contains:rei{!!title}]"><$transclude tiddler={{!!title}} mode=block/></$list>

Outside a filter,  transclusions use {{!!myfield}}  (double braces). Inside a filter, they replace the square brackets ...{!!myfield}... (single set of braces).

You can use the regexp filter operator to match at pretty much any level of detail.

James Anderson

unread,
Apr 11, 2021, 4:49:21 PM4/11/21
to TiddlyWiki
Thanks on both counts M.ark, the filter worked!

James
Reply all
Reply to author
Forward
0 new messages