List Filter: A plus B or C

86 views
Skip to first unread message

Sapphireslinger

unread,
Jun 11, 2020, 5:46:19 AM6/11/20
to TiddlyWiki
How to I get all tiddlers tagged with "lewrockwell" plus "best sentence" OR "best paragraph"?

<$list filter="[tag[(lewrockwell + (best sentence)||(best paragraph)] !sort[title]]">
<h2><$link><$transclude field="title" mode="block"/></$link></h2>
<$transclude field="text" mode="block"/>
</$list>

The above doesn't work.

Eric Shulman

unread,
Jun 11, 2020, 6:03:11 AM6/11/20
to TiddlyWiki
Let's assume you have three tags: A, B, and C.  To get the logical combinations of "A and (B or C)", start by refactoring the logic expression to remove parentheses:
A and (B or C) => (A and B) or (A and C)

In TW filter syntax, this can be written as two "filter runs", like this:
<$list filter="[tag[A]tag[B]] [tag[A]tag[C]]">
...
</$list>

enjoy,
-e

 

Sapphireslinger

unread,
Jun 11, 2020, 6:23:00 AM6/11/20
to TiddlyWiki
Thank you!

Jed Carty

unread,
Jun 11, 2020, 8:11:44 AM6/11/20
to TiddlyWiki
For future reference, I wrote up some notes about how to transfrom Boolean logic into filters here https://ooktech.com/jed/ExampleWikis/FilterLogicExamples/
It needs to be updated with some new filter operators that are available, but it covers the basics.

Mohammad Rahmani

unread,
Jun 14, 2020, 11:42:55 PM6/14/20
to tiddl...@googlegroups.com
This is one of the best sources to learn filter logic!

many thanks for sharing Jed!


Best wishes
Mohammad


On Thu, Jun 11, 2020 at 4:41 PM Jed Carty <inmy...@gmail.com> wrote:
For future reference, I wrote up some notes about how to transfrom Boolean logic into filters here https://ooktech.com/jed/ExampleWikis/FilterLogicExamples/
It needs to be updated with some new filter operators that are available, but it covers the basics.

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/5d451238-c35d-407d-ae69-6025b4658e3do%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages