![]() |
#1 |
Calibre Companion Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 873
Karma: 1088610
Join Date: Nov 2006
Device: Galaxy Note 4, Kindle Voyage
|
Having trouble creating a custom column
I'm trying to create a custom column that shows the series name if it exists, one of two tags if they exist, or "other". I have created this:
program: first_non_empty( field(‘series’), str_in_list( field('tags'),",", "_Next","Next", ""), str_in_list( field('tags'),",", "_Soon","Soon", ""), str_in_list( field('tags'),",", "_Favorites","Favorites",""), "Other" ) If I take out the series line and the other line it works. If I include those lines I get a template error. Any help would be appreciated. Thanks. |
![]() |
![]() |
![]() |
#2 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,444
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
The template will run faster if you fetch the tags once, as in Code:
program: t = field('tags'); first_non_empty( field('series'), str_in_list(t, ",", "_Next","Next", ""), str_in_list(t, ",", "_Soon","Soon", ""), str_in_list(t, ",", "_Favorites","Favorites",""), "Other" ) |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Calibre Companion Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 873
Karma: 1088610
Join Date: Nov 2006
Device: Galaxy Note 4, Kindle Voyage
|
Thanks very much. I can always count on you.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Pls help with creating a custom column | Mamaijee | Library Management | 12 | 09-26-2016 10:01 PM |
Sony book sorting by author fails when creating collections from a custom column | speakingtohe | Devices | 2 | 05-15-2014 01:27 PM |
Help creating custom column | apesmom | Calibre | 2 | 04-03-2014 11:30 AM |
Creating Custom Column for Read and Date Read | library addict | Calibre Companion | 11 | 03-22-2014 05:33 AM |
Creating a Custom Column Link | a_daley | Library Management | 5 | 02-16-2014 05:56 AM |