Search code examples
tiddlywikiwikitext

How to use a logical operator in WikiText to select a tiddler with one OR another tag?


The TiddlyWiki documentation provides an example of the tag operator:

[tag[task]]

This selects all tiddlers that have been tagged as task.

How though would one select all tiddlers tagged with one OR another tag; so for instance I want to select all tiddlers that are tagged either dog or cat? None of the below attempts succeed:

[tag[cat]||[dog]]
[tag[cat]OR[dog]]
[tag[cat, dog]]

For context, I'm looking to use this within a list, along the lines of:

<$list filter="[tag[cat]||[dog]]">
<$view field="title"/>
</$list>

Solution

  • A bit late but in case it's still useful...

    There are various ways to combine the results of different lists, and in this case one just needs the simple union of lists which is represented with a space between two filter expressions:

    <$list filter="[tag[cat]] [tag[dog]]">
    <$view field="title"/>
    </$list>
    

    The document about filters is rich but a bit messy, I think that this is explained in "Introduction to filter notation" but there are other relevant parts in "Filter expression", also here and possibly in other places.