List on current tiddler footer only on certain title

50 views
Skip to first unread message

Scott Kingery

unread,
Dec 19, 2019, 11:32:05 PM12/19/19
to TiddlyWiki
I have this list filter I'm using in a footer
<$list filter="[all[current]!title[Home]]">

If the tiddler is NOT titled Home it shows up. All good.

I tried to do the reverse
<$list filter="[all[current]title[Home]]">
to have it show up only on Home. It doesn't work and ends up showing on all tiddlers.

What am I missing to get it to show only on Home?

Scott Kingery

unread,
Dec 19, 2019, 11:50:01 PM12/19/19
to TiddlyWiki
Answering my own question...

Looks like this works to do what I want:
<$list filter="[all[current]field:title[Home]]">

Eric Shulman

unread,
Dec 19, 2019, 11:59:30 PM12/19/19
to TiddlyWiki
On Thursday, December 19, 2019 at 8:32:05 PM UTC-8, Scott Kingery wrote:
I tried to do the reverse
<$list filter="[all[current]title[Home]]">
to have it show up only on Home. It doesn't work and ends up showing on all tiddlers.


* Most operators derive their output from their input. For example, many of them output a subset of their input, and thus truly live up to the name of "filters", narrowing down the overall output of the containing run. These operators are called selection modifiers.
* A few operators ignore their input and generate an independent output instead. These are called selection constructors: they construct an entirely new selection.

The "[title[...]]" filter operator is a selection constructor.  Thus, in your filter expression, it doesn't matter that title[Home] is preceded by all[current].  It will always result in the value "Home" being returned by the filter.

Fortunately, there are several selection modifier filter operators that you can use to get the results you want:

* [all[current]field:title[Home]] tests to see if the field named title has a value of "Home"
or
* [all[current]match[Home]] tests the value of "all[current]" to see if it matches the literal text "Home"

note: you can also replace "all[current]" with the variable <currentTiddler> (SINGLE angle brackets for filters!), thus:

* [<currentTiddler>field:title[Home]]
or
* [<currentTiddler>match[Home]]

Any of the above filters should work for your desired end goal.

enjoy,
-e


.  For your purposes, you should use "field:title[Home]" which tests the input to see if 







Mohammad

unread,
Dec 20, 2019, 1:29:12 AM12/20/19
to TiddlyWiki
Added to TW-Scripts.

Scott Kingery

unread,
Dec 22, 2019, 12:38:02 AM12/22/19
to TiddlyWiki
Thanks for the explanation, Eric!
Reply all
Reply to author
Forward
0 new messages