Filter list by tag but sort by and show value of field

64 views
Skip to first unread message

Huw

unread,
Mar 31, 2019, 4:47:33 AM3/31/19
to TiddlyWiki
Currently I am using "<$list filter='[tag[TAGNAME]sort[title]]'/>" to produce a list of tiddlers by tag. Works fine.

However, what I would like to do (and have failed miserably) is to get a list of tiddlers by tag, sorted by and displaying the value of a specific field.

So for example I have tiddlers "Apple", "Orange", "Pear".

All have a field named "nameid" that contains a string and all have the tag "Fruit".

I would like to produce a list of all items with the tag "Fruit", but the list should be derived from and sorted by the value of the "id" field, so the list would be:

AppleIDString
OrangeIDString
PearIDString

rather than

Apple
Orange
Pear

Which is what I have now.

Any help would be much appreciated!

regards

Huw

Jed Carty

unread,
Mar 31, 2019, 4:52:54 AM3/31/19
to TiddlyWiki
It sounds like you need the get operator https://tiddlywiki.com/#get%20Operator

Try this:

<$list filter='[tag[TAGNAME]get[nameid]sort[]]'>


</$list>

Mohammad

unread,
Mar 31, 2019, 5:12:14 AM3/31/19
to TiddlyWiki
Added to TW-Scripts

Huw

unread,
Mar 31, 2019, 5:46:59 AM3/31/19
to TiddlyWiki
That is most excellent! Thanks! I missed that operator entirely!

regards

Huw
Reply all
Reply to author
Forward
0 new messages