Nested filters, filter syntax, and other filter problems #5878
Replies: 4 comments 13 replies
-
You can not use the type field, because TW uses it for the tiddler-mime-type. MIME-types are specified. In your case the filter would be I also don't know, why you would want to use |
Beta Was this translation helpful? Give feedback.
-
Hi! You want the filter[] or subfilter[] operators, but you will want to set up the "subfilter" as a Macro Definition (to avoid the nested [] syntax you have discovered does not work). To adapt the example to your use-case:
There is a bug where a javacript error happens if you use Variable syntax in filters defined as macros. So, you will have to redefine the Best, |
Beta Was this translation helpful? Give feedback.
-
Keep in mind, the point isn't the example, but the question of can we make gotchas go away by finding a more extensive grammar for filters that both 1) supports all current filters and 2) allows for more expressive queries without things becoming over-complicated. Also, as a survey for what problems people encounter with filters. This isn't a problem to be solved, it's a design question to be answered. |
Beta Was this translation helpful? Give feedback.
-
Hi @MartyGentillon with the upcoming v5.2.0 release, @joshuafontany's code can be simplified to a single filter:
See https://tiddlywiki.com/prerelease/#Filter%20Expression for more details. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, it is difficult to use filters to find values for the arguments to filter operations. It would be nice to change that. As an example use case, consider a Pokemon twiki, I want to list all pokemon with a particular type. The type tiddly is called
Grass Type
, and Pokemon keep their type in atype
field containing, for example,Grass
. To make this list I might want to use a filter like:But, currently this can only be done with a bunch of
<$set>
widgets and variables in the filter.I think it would be useful to have a filter notation which supported nested filter calls like the one above. Doing it in a backward compatible manner may present a problem, but I believe that it is mostly possible, barring edge cases (There is still design work to be done here).
This leads to a few questions:
Beta Was this translation helpful? Give feedback.
All reactions