Sorry for the late reply. Let me explain. The code in the first post is what I used for my own testing. The code in the second post is from my plugin. But Though the issue may be less important than just displaying a blank space on the page. It doesn’t really affect much. But I do wonder what the filter would do to fix this. I’ve been trying to figure it out for two or three nights in a row now, and I’ve scoured the forum posts and still haven’t found an answer.
Let me describe the problem in more detail next. Firstly I have some project entries that have fields as shown in the code below.
created: 20250618172550631
description:
modified: 20250618201040817
tags:
title: 789
tmo: Project
tmo_projectFilter: [tag<currentTiddler>]
tmo_projectState: doing
type: text/vnd.tiddlywiki
The key is the tmo_projectFilter field value, which is a filter that may contain variables and by default contains the currentTiddler variable.
Then I have some task entries as shown in the code below. This entry has a label, which is not mandatory, it just does it by default. There are several similar entries. The field tmo_taskState in there can usually be divided into two categories, those that are todo and those that are not. it’s easy to tell.
created: 20250620191840642
modified: 20250620191845045
tags: 789
title: 66
tmo: Task
tmo_dueDate:
tmo_taskState: done
type: text/vnd.tiddlywiki
Now the real problem arises. I need to filter a series of project entries and parse the tmo_projectFilter
filter within them. If the number of task entries filtered by this filter where the value of the field tmo_taskState
is “todo” is not zero, then this project needs to be displayed; otherwise, it does not. If none of the project entries have task entries with tmo_taskState
value “todo”, I need to provide a blank template. This is what I want.
The problem I’m currently having is that I’m splitting this filter into two parts. If I use a blank template in the second part, then there is an issue where an item that has subtasks with todo is displayed. The other project has no sub-tasks for todo and will show up as a blank template. A third project also has no subtasks for todo and will also show the blank template. This displays two blank templates. And this is not what I was expecting. The current example sets the blank template to blank in the second filter section. This results in that if all of the items do not have subtasks for todo, then only blanks are displayed, not a specific blank template entry as I would expect.
I haven’t researched new features like functions enough. I think my experience with TiddlyWiki is okay, but I still can’t solve this problem. I’m sure TiddlyWiki’s powerful filters could solve this, but perhaps there are some very technical issues here. Another possible solution would be to write a filter expression via js that handles it specifically, and that’s beyond my capabilities.
Hopefully this explains it all, and any discussion and attempts to solve this problem are welcome.