Filter operator "title"

88 views
Skip to first unread message

UBi

unread,
Jul 29, 2015, 10:17:51 AM7/29/15
to TiddlyWiki
Hello,

What is wrong with the following filter?
IMO the following snippet should only show "I am XXX!", if the Tiddler containing it is named "XXX". But it shows "I am XXX!" regardless of the Tiddler name.
Help, please.
Uwe

<$list filter="[all[current]title[XXX]]">
I am XXX!
</$list>



Felix Küppers

unread,
Jul 29, 2015, 10:31:49 AM7/29/15
to tiddl...@googlegroups.com
Hi Uwe,

this was one of my first misunderstandings too and it seems that many people share this misunderstanding. The title flter is not a filter but a "selector". It just pipes out everything that enters it (all[current]) plus the aspect it deals with (in your case XXX). You should use the prefix filter ([all[current]prefix[xxx]]) or ([all[current]field:title[xxx]]). field:title is different from title – see tiddlywiki.com docs.

-Felix
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/2f7724f9-e97d-4315-b747-4af8e1863dca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

UBi

unread,
Jul 29, 2015, 12:06:18 PM7/29/15
to TiddlyWiki, felixk...@hotmail.de
Ah OK, thank you very much. A selector. I'll shall re-read the docs.

Another one: A Tiddler X containing "<$list filter="[all[current]tagging[]" />" and tagging Tiddler A and B expectedly shows "A B".
It will not, when transcluded. Why? (yes, I really should start a new thread. Next time, I promise).

Jed Carty

unread,
Jul 29, 2015, 12:25:21 PM7/29/15
to TiddlyWiki, u...@kefc.de
The value of currentTiddler, is a variable which is generally set to whichever tiddler is being rendered. Transclusions count as the containing tiddler, not the transcluded tiddler. This is by design so that templates work. That is why when you transclude a tiddler with your filter it doesn't act like you expect.

There are two way around this that I generally use. The first is the tiddler widget which sets the value of currentTiddler

<$tiddler tiddler=xxx>
{{xxx}}
</$tiddler>

the other way, which I use more often, is using a list widget. Inside a list widget the value of currentTiddler is set to the current item in the list. So

<$list filter='[is[current]field:title[XXX]]'>
{{XXX}}
</$list>
Reply all
Reply to author
Forward
0 new messages