View Single Post
Old 02-25-2011, 12:46 PM   #3
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,465
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
You should look at "template program mode" in http://calibre-ebook.com/user_manual/template_lang.html. That mode allows you to write more arbitrary programs. For example, your original program could be written as
Code:
{#gr_2read:'test($,"To Read",strcat(field("author_sort"),"/",field("series")))'}/{title} - {authors}
or
Code:
{#gr_2read:'test($,"To Read",template("[[author_sort]]/[[series]]"))'}/{title} - {authors}
Use "general program mode" for even more flexibility.
Code:
program:
  strcat(
    test(field('#gr_2read'), "To Read", template("{author_sort}/{series}")),
    template('/{title} - {authors}')
  )
chaley is offline   Reply With Quote