Please help me write a filter expression

219 views
Skip to first unread message

David Gifford

unread,
Oct 25, 2013, 8:57:00 AM10/25/13
to tiddl...@googlegroups.com
Oh Lord why do I keep coming up with new ideas?

I am trying to write a list which returns:

1. All the tiddlers tagged by the current tiddler
2. All the tiddlers which tag the current tiddler
3. All the tiddlers linked in the current tiddler
4. All the tiddlers which have links to the current tiddler
5. And then combines them into one alphabetized list.

I tried

|<$list filter="[is[current]tags[]tagging[]links[]backlinks[]sort[title]]" emptyMessage=""></$list>|

But nothing happens.

I tried

|<$list filter="[is[current][tags[]][tagging[]][links[]][backlinks[]][sort[title]]" emptyMessage=""></$list>|

And I got a whole lot of stuff that shouldn't be there.

I tried

|<$list filter="[is[current][tags][is[current]tagging][is[current]links][is[current]backlinks]sort[title]]" emptyMessage=""></$list>|

But nothing turns up.

I tried

|<$list filter="[is[current][tags[]]tagging[]]links[]]backlinks[]]sort[title]]" emptyMessage=""></$list>|

And got stuff that shouldn't be there.

I tried

|<$list filter="[is[current[tags[]tagging[]links[]backlinks[]sort[title]]" emptyMessage=""></$list>|

But nothing turns up.

So I am at a loss. I tried several things to avoid having to bother you all, but now it is time to admit defeat and turn to the pros.


Jeremy Ruston

unread,
Oct 25, 2013, 9:08:16 AM10/25/13
to TiddlyWiki
Hi Dave

Here's how to do it:

<$list filter="[is[current]tagging[]] [is[current]tags[]] [is[current]links[]] [is[current]backlinks[]] +[sort[]]"/>

It breaks down like this. First there are four sub-filters that operate in turn, adding the tiddlers that they select to the pool of selected tiddlers:

[is[current]tagging[]] - selects all tiddlers that the current tiddler is tagging

[is[current]tags[]] - selects all tags of the current tiddler

[is[current]links[]] - selects all links out of the current tiddler

[is[current]backlinks[]] - selects all links into the current tiddler

Then this final filter operator works differently because of the leading '+'. It means that the filter operator is applied to all of the tiddlers that have been selected so far (rather than applying to all available tiddlers). So the '+' gathers up all of the results so far, and then sorts by title:

+[sort[]]

Does that work for you?

Best wishes

Jeremy




--
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.
For more options, visit https://groups.google.com/groups/opt_out.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

David Gifford

unread,
Oct 25, 2013, 9:12:08 AM10/25/13
to tiddl...@googlegroups.com
Yeah! After I added 'title' to the sort bit, it worked like a charm. Thanks Jeremy! Now get back to work. :-)


--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/bE0Oiyonn7g/unsubscribe.
To unsubscribe from this group and all its topics, 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.
For more options, visit https://groups.google.com/groups/opt_out.



--
David Gifford
Christian Reformed World Missions, Mexico City

Jan Johannpeter

unread,
Oct 25, 2013, 3:34:16 PM10/25/13
to tiddl...@googlegroups.com
Hallo Dave, Hallo Jeremy
Interesting Function. Which plugin is needed and where exactly do you
put it to make it work?
Jan

Jeremy Ruston

unread,
Oct 25, 2013, 3:36:18 PM10/25/13
to TiddlyWiki
Hi Jan

I'm afraid this thread is about TiddlyWiki5, not TiddlyWiki Classic. I'm sure something similar could be done with Classic, though,

Best wishes

Jeremy


To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscribe@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/groups/opt_out.
--
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+unsubscribe@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/groups/opt_out.

David Gifford

unread,
Oct 25, 2013, 3:51:34 PM10/25/13
to tiddl...@googlegroups.com
Hi Jan

If you ARE talking about TiddlyWiki 5, you can add it anywhere, really. You can see my use of it in the ViewTemplate of a TiddlyWiki 5 here: http://giffmex.org/notestorm5preview.html

Dave

David Gifford

unread,
Oct 25, 2013, 7:57:27 PM10/25/13
to tiddl...@googlegroups.com
Hi Jan

TiddlyWiki 5 is a complete rewrite and is not downward compatible. The macros will not work, and your content will need to be added tiddler by tiddler and the markup slightly modified to appear correctly in TW5.

The main migration differences for markup:

1. CSS wrapping of content in classic will need to be revised to the new markup, and there is no way to format individual cells as there was in classic.
2. You will need double newlines between numerous elements, and <br> if you want single line breaks between lines.

Dave


On Fri, Oct 25, 2013 at 6:51 PM, Jan Johannpeter <lasjo...@gmail.com> wrote:
Thanks for your responses.
Perhaps it's time to upgrade.
This brings me to questions which have been urging me for some time:
Is TW5 downward compatible?
Will my old macros still work?
Is there a comparsion and a migrationguide somwhere...or will this  come with the final version?

Jan

--
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+unsubscribe@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/bE0Oiyonn7g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+unsubscribe@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/groups/opt_out.

Tobias Beer

unread,
Oct 30, 2013, 4:02:26 PM10/30/13
to tiddl...@googlegroups.com
Hi Dave,

while it's certainly nice that TW5 filters produce your desired output I was wondering in which context you would want such a list.

Tobias.

David Gifford

unread,
Oct 30, 2013, 6:53:47 PM10/30/13
to tiddl...@googlegroups.com
Hi Tobias, http://www.giffmex.org/notestorm5preview.html shows what I was after, though I separated tags and links.

Dave

Jan Johannpeter

unread,
Oct 25, 2013, 7:51:22 PM10/25/13
to tiddl...@googlegroups.com
Thanks for your responses.
Perhaps it's time to upgrade.
This brings me to questions which have been urging me for some time:
Is TW5 downward compatible?
Will my old macros still work?
Is there a comparsion and a migrationguide somwhere...or will this come
with the final version?

Jan



Am 25.10.2013 21:51, schrieb David Gifford:
Reply all
Reply to author
Forward
0 new messages