Default tiddlers puzzler

Hello. I’m seeing something I don’t understand with the default tiddler list. For some reason, any expression I put before the filter with the or operator will not display. Subsequent filters are working fine. If I move [[Welcome]] after the 2nd expression it displays. I tried to put another set of brackets around the second expression, hoping that would corral it somehow, but that threw an error.

[[Welcome]]
[tag[journal-entry]] [tag[aside]] +[!sort[created]limit[1]]
[!is[system]!tag[home]!tag[picture-post]!tag[aside]!tag[journal-entry]!sort[created]limit[8]]
[[Links]]
[[Random quote]]

The problem is caused by +[!sort[created]limit[1]] which is being applied to ALL input items that precede it, including the initial [[Welcome]] item. Because of the limit[1] operator, if there is a tiddler tagged with journal-entry or aside, then only the most recent single item is retained and I suppose that your [[Welcome]] tiddler is older than either the journal-entry or aside tiddlers.

To make the overall filter work the way you want, you’ll need to isolate the evaluation of the [tag[journal-entry]] [tag[aside]] +[!sort[created]limit[1]] filter so it doesn’t affect any items that come before it. As you’ve already noted, adding extra brackets around that part of the filter doesn’t work.

One method to achieve your desired result is use the subfilter operator to evaluate the [tag[journal-entry]] [tag[aside]] +[!sort[created]limit[1]] filter in isolation, like this:

First, create a tiddler (e.g. $:/DefaultTiddlersSubfilter) containing:

[tag[journal-entry]] [tag[aside]] +[!sort[created]limit[1]]

Then, in $:/DefaultTiddlers, write:

[[Welcome]]
[subfilter{$:/DefaultTiddlersSubfilter}]
[!is[system]!tag[home]!tag[picture-post]!tag[aside]!tag[journal-entry]!sort[created]limit[8]]
[[Links]]
[[Random quote]]

Sure, it’s a bit ugly, but it will give you the results you want.

-e

3 Likes

It works! I love it. Thank you.