Hi all,
Does anyone know of a filter operator that accepts a list of titles as input, the operand is the name of a list field of the current tiddler, and the output is all input titles contained in the list field?
I've looked at the listed operator but it's not the same function. I'm thinking of creating my own custom filter operator to do this.
My usecase is the following:
In my personal knowledge base setup, I have topic, note, task, and bookmark tiddlers that are linked together. When I create these tiddlers, I assign a unique identifier which I call pkb-id. This is currently just the tiddler creation date in a specific format.
Let's say for a topic tiddler, I may have several note tiddlers linked to it or several related bookmarks or tasks. To do this, I create a notes or bookmarks field in the topic tiddler that list all the pkb IDs of the related tiddlers. I then use a conditional view template that reads these list fields and displays in the tiddler body all the related notes, tasks, and bookmarks for each topic tiddler.
I have an existing implementation that works but that, I think, is horribly inefficient. I use enlist and tobi beer's filter operator. For example, if I want to list all the related notes of a topic tiddler, I currently do this:
<$vars subfilter="[all[tiddlers]!is[system]tag[$:/.em/type/note]field:pkb-id[%inputTitle%]]">
<$list filter="[enlist{!!notes}filter<subfilter>sort[title]]"
emptyMessage="There are currently no notes being referenced by this topic"
template="$:/.em/templates/pkb-list-item"
/>
</$vars>
Basically, I loop thru all the note tiddlers for each ID listed in the notes field, checking the pkb-id field of each tiddler if there's a match. Imagine if I have a topic with a hundred related notes. That is going to make things very, very slow.
So now what I want to do is loop thru all the notes and check if each note's pkb-id is contained in the notes field of the current tiddler. That will be just one loop no matter how many related notes there are.
Regards,
Eric