Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 08-30-2021, 11:27 AM   #1
Boilerplate4U
Enthusiast
Boilerplate4U began at the beginning.
 
Boilerplate4U's Avatar
 
Posts: 38
Karma: 10
Join Date: Jul 2020
Device: Kobo Clara HD
Conditional statements or scripting in "Book list template" ?

Is it possible (and if so how) to use conditional statements or scripting in "Book list template"?

I've got a custom column called "#winner" of type yes/no that I'd like to present only if it's set to yes..
--

Boilerplate4U is offline   Reply With Quote
Old 08-30-2021, 11:54 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,300
Karma: 27111240
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No, it's a very simple template language. No scripting, conditional expressions. IIRC yes/no columns become yes or no only.
kovidgoyal is offline   Reply With Quote
Advert
Old 08-30-2021, 01:10 PM   #3
Boilerplate4U
Enthusiast
Boilerplate4U began at the beginning.
 
Boilerplate4U's Avatar
 
Posts: 38
Karma: 10
Join Date: Jul 2020
Device: Kobo Clara HD
Ok, thanks for the prompt reply! Cheers!
Boilerplate4U is offline   Reply With Quote
Old 08-30-2021, 04:14 PM   #4
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,408
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
I haven't tried this but I suspect you could make a "Column built from other columns" (composite columns) that computes the result you want, then use that column in the book list template.

Composite columns use the full template language, which supports conditionals and computation.
chaley is offline   Reply With Quote
Old 08-30-2021, 11:53 PM   #5
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,891
Karma: 74203799
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
While not quite the same thing, device save paths are limited to the simpler template too, so I created a composite column called #kobopath and used that in the path.
ownedbycats is offline   Reply With Quote
Advert
Reply

Tags
book list template, conditional statements, scripting


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pressing "Restore Defaults" under "Book Details" wipes all "Look & Feel" settings. MarjaE Library Management 1 03-30-2021 11:46 AM
Multiple regexes in "save book to disk" template? Phssthpok Library Management 1 07-12-2018 04:20 AM
"Add a book" template like "Save to disk"? vr8ce Library Management 10 06-09-2017 08:16 AM
Error: "can only concatenate list (not "unicode") to list" bmuesse Library Management 2 01-11-2013 03:50 PM
"Dear Author" list of e-book publishers and vendors Bob Russell Deals and Resources (No Self-Promotion or Affiliate Links) 0 06-05-2006 04:08 PM


All times are GMT -4. The time now is 05:29 AM.


MobileRead.com is a privately owned, operated and funded community.