09-17-2012, 04:03 AM | #1 |
Member
Posts: 16
Karma: 498230
Join Date: Sep 2012
Device: Kobo Aura One, Kobo Glo HD
|
Collection order
Hi,
joined today and already have a question. I use a couple of custom columns to manage the collections of my readers. The collections should be in a specific order (currently read books, then series, then tags etc). For fields with only one value, eg series I copy the field and add a number at the beginning, like {series:|1. |}. My only problem is that this don't work with tags, as there are multiple comma separated values in it. I guess I have to use subitems or sublist, but how can I add a text in front of each value? Any hint is really appreciated |
09-17-2012, 05:24 AM | #2 |
Grand Sorcerer
Posts: 11,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
If the same prefix is put on each tag then you can do it with list_re.
If the prefix must change according to the value of the tag, then things are much more interesting. It can be done in general program mode with a sequence of list_re, one for each value to change, but this will have bad performance. If you know some programming and python, then the best approach would be a custom formatter function, because you can loop over the values and generate whatever result you want. |
Advert | |
|
09-17-2012, 06:21 AM | #3 |
Member
Posts: 16
Karma: 498230
Join Date: Sep 2012
Device: Kobo Aura One, Kobo Glo HD
|
Hi chaleay,
many thanks. All tags will have the same prefix, so I guess list_re will work. Unfortunately I do not have any programming experience any my try failed. Could you please give me a hint on how to use it in a custom column? Cheers, |
09-17-2012, 06:37 AM | #4 |
Member
Posts: 16
Karma: 498230
Join Date: Sep 2012
Device: Kobo Aura One, Kobo Glo HD
|
Nevermind, I found my error.
If anyone wants to achive the same, this is what I did: program:list_re(field('tags'), ',', '^', 'prefix') Thanks again to point me in the right direction. |
09-17-2012, 07:08 AM | #5 |
Grand Sorcerer
Posts: 11,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
@bump: you could also do the job in template program mode with
Code:
{tags:'list_re($, ',', '^', 'prefix')'} |
Advert | |
|
09-17-2012, 08:17 AM | #6 |
Member
Posts: 16
Karma: 498230
Join Date: Sep 2012
Device: Kobo Aura One, Kobo Glo HD
|
Thats awesome, thanks chaley
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PRS-T1 Collection order | JSWolf | Sony Reader | 8 | 12-28-2011 01:42 AM |
How to list collection in descending order? | jackhulk | Library Management | 8 | 10-16-2011 01:12 PM |
Getting Collection in Order. | ErikaGC | Library Management | 2 | 09-15-2011 08:26 PM |
Collection (via Calibre) out of order? | Trauma Doll | Sony Reader | 2 | 12-27-2008 10:56 PM |
Book order in a collection using Libprs | stustaff | Calibre | 13 | 12-03-2007 12:21 PM |