Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 02-07-2021, 08:03 PM   #1
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,977
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Help with another template

My old #kobopath column (used for my device save template) was an enumerated column...which had the same values my top-level tags. So I changed it to this:

Code:
{tags:'list_re($, ',', '^(.*?)($|\..*$)', '\1')'}
This works as expected with the way my tags are setup - it shows Fiction, Nonfiction, Fanfiction, etc and it works with my save template.

However, my old enumerated column also had a separate entry for PDFs. How would I change this template so that it shows "PDFs" instead of the top-level tag if that's the only available format?


Last edited by ownedbycats; 02-07-2021 at 08:20 PM.
ownedbycats is online now   Reply With Quote
Old 02-07-2021, 08:50 PM   #2
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
My first thought is something like:
Code:
program:
if approximate_formats() == 'PDF' then
   'PDF'
else
    list_re(field('tags'), ',', '^(.*?)($|\..*$)', '\1')
fi
davidfor is offline   Reply With Quote
Advert
Old 02-07-2021, 09:34 PM   #3
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,977
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
yes, that works! I was trying to figure out how to get approximate_formats right. Thank you.
ownedbycats is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Template help Grebenshchikov Library Management 4 01-01-2021 08:45 PM
"Normal" template inside GPM template ownedbycats Library Management 20 12-02-2020 09:40 PM
Help with a template dunhill Library Management 10 06-04-2020 06:34 AM
Using built-in template functions in a custom template function ilovejedd Library Management 4 01-28-2018 12:20 PM
Help with template KALKITO Library Management 1 07-02-2012 02:54 PM


All times are GMT -4. The time now is 04:11 PM.


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