Filter question: Exclude titles that fulfill conditions given in a field

I have a field in the current tiddler with the following

[prefix[$:/state/]] badTitle [[spaced title]] [prefix[$:/temp/]]

First a simplified question that might just have the same answer as the actual question:

How can I transclude this field so it’s contents are used as a filter?
E.g {{{ [{!!myfield}] }}} or {{{ [enlist{!!myfield}] }}} don’t work as the filters are interpreted as literal strings rather than evaluated.

Actual question:

How can I filter all tids tagged Foo but excluding those that match the conditions given in that field? I.e all tiddlers tagged Foo excluding titles prefixed $:/state/ or $:/temp/ and also excluding the specific titles mentioned.

The field content should ideally not have to be “massaged” (e.g introducing “minus” characters) because the content will actually be added by the users and I don’t want to complicate things for them. The idea is that they will see a long title list and an edittextwidget with some predefined values (as illustrated above) and they can add their own values in the editor to further exclude batches of tiddlers from the list.

Help appreciated :slight_smile:

Just looking at your simplified example.

Is this what you want?

Screenshot 2023-05-19 2.57.53 PM

Does this work for you?

{{{ [tag[Foo]] -[subfilter{!!myField}] }}}

<$list filter={{{...}}}>

Whoa, that combo was new to me! It makes me realize my simple example was a bit too simple though, because not everything in the filter should be evaluated before it is used as part of the filter. …(or does that not matter?)

A hopefully better example (still simplified) might be:

{{{ [tag[foo]] [{!!myfield}] }}}

YES! Even for my more complex question.

Thank you @Charlie_Veniot and @etardiff

  • Keep in mind this evaluates the whole filter and makes it the list widgets filter.
  • It may be sufficient to use <$list filter="[tag[Foo]] -[subfilter{!!myField}]" ...
    • or +[subfilter{!!myField}] in other cases.
  • subfilter is the main way to get filters stored in variables or fields into filters when the field or variable does not contain the whole filter like this filter=<<filter>> or filter={{!!filter}} or the {{{ filter }}} already covered.
1 Like