View Single Post
Old 04-11-2011, 06:44 PM   #567
TheD0ct0r
Enthusiast
TheD0ct0r began at the beginning.
 
Posts: 35
Karma: 12
Join Date: Nov 2009
Device: Kindle
Quote:
Originally Posted by meme View Post
3. Yes. See the Examples section on the first post under Custom Columns. What you are looking for is to create a custom column based on other columns. To fill the column with "Short Stories" if there is a tag called "SS" or with Author Sort if there is no tag "SS", use the template: {tags:'contains($,"SS","Short Stories", field("author_sort"))'} I think I might add that as a new example as it shows how powerful Calibre's templates are.
What if I have multiple tags? For example, "SS" for Short Stories, "Single Author" for those authors that I only have 1 book, or no tag for all the others? Can I specify multiple "Contains" arguments?

Edit: Figured this one out through trial and error:

{tags:'contains($,"SS","Short Stories", contains($,"Single","Authors with only 1 book", field("author_sort")))'}

Thanks again!

Last edited by TheD0ct0r; 04-11-2011 at 06:49 PM.
TheD0ct0r is offline