[TW5] filter list by multiple (2) tags and sort by field "order"

2,434 views
Skip to first unread message

Dave

unread,
Apr 3, 2016, 1:18:27 AM4/3/16
to TiddlyWiki
Hi, I'm trying to figure out filtered lists.

I have this table that works nicely:
<table>
<thead><tr><td>Slide</td><td>order</td></tr></thead>
<$list filter="[tag[slide]sort[order]]">
<tr><td><$link to={{!!title}}> * </$link>
<$appear show="<$text text={{!!title}}/>" $state="tiddler-slider" mode="block">
<$transclude mode="block" tiddler={{!!title}}/>
</$appear>
</td><td><$edit field="order" class="tc-edit-texteditor"/></td></tr></$list>
</table>

It lists all the tiddlers with the tag="slide" and puts them in order of whatever is in the tiddlers' fields "order"

I've tried many different ways of adding a second tag ("aside") into the list, but nothing is working.

*[tag[slide]tag[aside]sort[order]]
lists only those with both tags present


*[tag[slide]][tag[aside]][sort[order]]
lists a whack load of tiddlers (including those without the tags "slide" or "aside") but it does put the ones with the field "order" in the right order.
*this would work if I could get rid of all the extraneous tiddlers

**[tag[slide]sort[order]][tag[aside]sort[order]]
does list all the right tiddlers, but the sorting is separately done, i.e. there's the list of one in order and then the list of the other in order, but I need them to be intermixed


Does anyone know how to do this, or is it not possible?

Thanks,
Dave

Eric Shulman

unread,
Apr 3, 2016, 1:42:43 AM4/3/16
to TiddlyWiki
On Saturday, April 2, 2016 at 10:18:27 PM UTC-7, Dave wrote:
*[tag[slide]][tag[aside]][sort[order]]
lists a whack load of tiddlers (including those without the tags "slide" or "aside") but it does put the ones with the field "order" in the right order.
*this would work if I could get rid of all the extraneous tiddlers

Try this:

[tag[slide]] [tag[aside]] +[sort[order]] 

The "+" prefix on the last filter run is important.  This limits the initial set for the sort filter to just those that are already in the list.

-e

Dave

unread,
Apr 3, 2016, 2:01:58 AM4/3/16
to TiddlyWiki
Thank you Eric, that worked (of course ;)

So I guess that means that if you don't have the "+" its basically calling for all tiddlers regardless of the previous tags because its not within a bracket structure like [tag[Foo]sort[order]]

PMario

unread,
Apr 3, 2016, 5:33:12 AM4/3/16
to TiddlyWiki
On Sunday, April 3, 2016 at 8:01:58 AM UTC+2, Dave wrote:
Thank you Eric, that worked (of course ;)
So I guess that means that if you don't have the "+" its basically calling for all tiddlers regardless of the previous tags because its not within a bracket structure like [tag[Foo]sort[order]]
Reply all
Reply to author
Forward
0 new messages