My question is:
I keep some tiddlers in a field: diary of Jornal tiddlers. I am looking for a filter to store those tiddlers under diary subfolder on my file system. I tried below with no success.
Example file structure
Assume a tiddler called “16th August 2024” and has a diary field with: One Two [[Thirty Four]], then file system path filter shall save tiddlers as below file structure.
I had to place the filter higher in the filters list, before the “catchall” last line
I had to replace all[] by all[tiddlers] because the former means “copy every tiddler from my input to my output”, so it’s like a “do nothing” operator.
Oh, I see, you published your answer while I was writing mine!
What I understood of OP is that tiddlers listed in the diary field of any other tiddler should get a diary/ prefix, hence my answer. Maybe I misunderstood?
The question is to find a file system path filter to store tiddlers appear in diary field of other tiddlers, in diary sub folder. The tiddlers have diary field is not the question.
So assume a tiddler called “16th August 2024” and has a diary field with: One Two [[Thirty Four]], then file system path filter shall save the One Two [[Thirty Four]] into diary subfolder.
Every path in TW has to be a subdirectory of /tiddlers/ – So it has to be /tiddlers/diary/*
I think your usecase can not be done with this configuration. It does not change other tiddlers. So if 16th_august_2024.tid is saved, it is the only tiddler that is handled.
If “One” is saved it does not look at other tiddlers, except “One”.
I would need to run more tests and probably have look into the code, to see if that would be possible.
The main problem I see, will be performance. Checking every other tiddler for a field value if it contains currentTiddler will be slow, if the number of tiddlers is high.
As @pmario said, all tiddlers and sub directories will reside under tiddlers directory as long as the tiddlywiki.info does not alter the default-tiddler-location.
Strangely [has[title]] is required at the beginning of this filter. So, if you use [all[tiddlers]contains:diary<currentTiddler>] :and[addprefix[diary/]], it does not work!
It’s important to note that simply adding an existing tiddler to the dairy field of other tiddlers does not move it to the diary directory. A tiddler will only be stored under the diary directory if you modify the tiddler itself and then save it back to the disk.