TW5 - How to display values of fields on a list tiddly

2,866 views
Skip to first unread message

Zan Thrax

unread,
May 22, 2014, 12:02:51 PM5/22/14
to tiddl...@googlegroups.com
I'm just trying to use TiddlyWiki for the second time, and I have managed to make a tiddler that is just a list of all items with a particular tag, and how to sort that list by the value of a custom field that I'm using on all Tiddlers with that tag. But I can't figure out any way to display the value of that field as well.

<$list filter="[tag[Ring]sort[price]]">

Gives me the listing of all tiddlers with the tag "Ring", sorted by the custom field "price". But I'd like to also have the value of the custom field "price" (and possibly a second custom field, "CL") listed behind each entry.

Can anyone help me with this? The info on the TiddlyWiki Wiki about custom fields doesn't seem relevant to what I'm trying to do.

Alberto Molina

unread,
May 22, 2014, 1:45:35 PM5/22/14
to tiddl...@googlegroups.com
Hi Zan Thrax

Try this:

<$list filter="[tag[Ring]sort[price]]">

{{!!title}} {{!!price}} {{!!CL}}

</$list>

Alberto

Message has been deleted

Zan Thrax

unread,
May 22, 2014, 3:08:05 PM5/22/14
to tiddl...@googlegroups.com
Thanks! That works perfectly.

As a follow up, is there any way to format the output of the price so that I can have the data be a simple integer (4000) but have it display w/ commas (4,000) ? If not, it's easy enough to change the data to include the commas.

Alberto Molina

unread,
May 22, 2014, 3:17:11 PM5/22/14
to tiddl...@googlegroups.com
Sorry, I don't know.

Zan Thrax

unread,
May 22, 2014, 3:50:01 PM5/22/14
to tiddl...@googlegroups.com
Hmm. I've just noticed two things. The first is that using the code Alberto posted makes the titles not display as links, the second is that my sort[price] is sorting alphanumerically rather than by value (i.e. 3000 before 900)


On Thursday, May 22, 2014 11:45:35 AM UTC-6, Alberto Molina wrote:

Alberto Molina

unread,
May 22, 2014, 6:24:11 PM5/22/14
to tiddl...@googlegroups.com
Hi Zan Thrax,


Hmm. I've just noticed two things. The first is that using the code Alberto posted makes the titles not display as links,

To see the titles display as links:

<$link>{{!!title}}</$link>

or

<$link><$view field="title"/></$link>


the second is that my sort[price] is sorting alphanumerically rather than by value (i.e. 3000 before 900)

To sort by value, use: 

nsort[price]

Regards,
Alberto


Zan Thrax

unread,
May 22, 2014, 7:05:13 PM5/22/14
to tiddl...@googlegroups.com
Thanks again Alberto. With those changes I have what I wanted. (except commas, which I can live without just fine)


--
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/T8_TFDM_yco/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/d/optout.

Reply all
Reply to author
Forward
0 new messages