View Single Post
Old 07-06-2013, 04:54 PM   #3
PeterT
Taking a break; Fed up
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 6,758
Karma: 43922916
Join Date: Nov 2007
Location: Toronto
Device: Wife: Touch, Arc, Vox Me: Nexus 7, Glo
See http://manual.calibre-ebook.com/template_lang.html

Try this:

Code:
{:'in_list(approximate_formats(), ',' , 'MOBI',  'Y',  '')'}
Quote:
approximate_formats() – return a comma-separated list of formats that at one point were associated with the book. There is no guarantee that the list is correct, although it probably is. This function can be called in template program mode using the template {:'approximate_formats()'}. Note that format names are always uppercase, as in EPUB.
Quote:
in_list(separator, pattern, found_val, not_found_val) – interpret the field as a list of items separated by separator, comparing the pattern against each value in the list. If the pattern matches a value, return found_val, otherwise return not_found_val.
Also see the documentation for Using functions in templates - template program mode
PeterT is offline   Reply With Quote