![]() |
#1 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,973
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
![]()
I've been reading over the template language page over and over but I'm not having much luck understanding what to do.
I have two columns, #read (yes/no) and #lastread (date). I was trying to make a composite #currentlyreading column that returns a yes/true result if #read:false and #lastread is set to anything. (I'd like to use it for sorting my currently-reading books to the top of the list in View Manager.) I was trying to use the check_yes_no and if not empty but all my results either got strings of code or template errors appearing in the composite column. ![]() |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Use the template
Code:
program: test(check_yes_no('#mybool', 0, 1, 0), test(field('#mydate'), 'Yes', ''), '') Note that this template returns "Yes" or empty. If you want "No" then change the empty strings ('') to 'No'. You can also distinguish between the Yes/No column set to False when there is no date by changing only the first ''. You might want to check the box "Show checkmarks" in the definition of your composite column. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,973
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
It works!
I changed #read to 1, 1, 0 so that it also gets undefined states (I don't use the tristate y/n columns, so a non-set one displays as 'no') and it works well. ![]() |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Need help with composite column | BookJunkieLI | Library Management | 2 | 07-03-2019 11:42 AM |
Composite Column | BetterRed | Calibre | 12 | 09-01-2013 04:58 AM |
Set value of another column from composite? | dirgeon | Library Management | 1 | 02-03-2013 11:40 AM |
Composite column or not ? | Bertrand | Library Management | 3 | 08-24-2011 01:27 AM |
Custom Composite Column | silentguy | Calibre | 4 | 11-24-2010 10:28 AM |