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-25-2011, 04:05 PM   #1
blu-
Enthusiast
blu- knows what's going on.blu- knows what's going on.blu- knows what's going on.blu- knows what's going on.blu- knows what's going on.blu- knows what's going on.blu- knows what's going on.blu- knows what's going on.blu- knows what's going on.blu- knows what's going on.blu- knows what's going on.
 
Posts: 43
Karma: 25968
Join Date: Nov 2010
Device: prs 650
Can someone make an "if" template for me?

I want to show the series, but if it isn't specified it'll show the title instead.

This is for when saving to disk. I try to read the manual, but it's too complicated for me. Thanks.
blu- is offline   Reply With Quote
Old 02-25-2011, 08:18 PM   #2
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,251
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Try something like this in your save template:
Code:
{series} {series_index:0>2s|| - }{title}
jackie_w is offline   Reply With Quote
Old 02-26-2011, 01:19 AM   #3
blu-
Enthusiast
blu- knows what's going on.blu- knows what's going on.blu- knows what's going on.blu- knows what's going on.blu- knows what's going on.blu- knows what's going on.blu- knows what's going on.blu- knows what's going on.blu- knows what's going on.blu- knows what's going on.blu- knows what's going on.
 
Posts: 43
Karma: 25968
Join Date: Nov 2010
Device: prs 650
I only want it to show the title, if there's no series. That is, they won't both appear at the same time. Thanks.
blu- is offline   Reply With Quote
Old 02-26-2011, 08:11 AM   #4
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,251
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Second attempt:
Code:
{series:'ifempty($,field('title'))'}{series_index:0>2s| |}
If this still isn't what you meant, then you need to give some examples of book series/title names from your library with the saved names you're trying to give them.
jackie_w is offline   Reply With Quote
Old 02-26-2011, 01:28 PM   #5
blu-
Enthusiast
blu- knows what's going on.blu- knows what's going on.blu- knows what's going on.blu- knows what's going on.blu- knows what's going on.blu- knows what's going on.blu- knows what's going on.blu- knows what's going on.blu- knows what's going on.blu- knows what's going on.blu- knows what's going on.
 
Posts: 43
Karma: 25968
Join Date: Nov 2010
Device: prs 650
That works. Thank you.
blu- is offline   Reply With Quote
Old 06-05-2011, 06:55 PM   #6
ElfN
Enthusiast
ElfN began at the beginning.
 
Posts: 26
Karma: 10
Join Date: Oct 2010
Device: Samsung SM-T290
How do I piggyback :shorten onto that?
ElfN is offline   Reply With Quote
Old 06-05-2011, 07:32 PM   #7
ElfN
Enthusiast
ElfN began at the beginning.
 
Posts: 26
Karma: 10
Join Date: Oct 2010
Device: Samsung SM-T290
And why does
Code:
{series:'ifempty($,field('#genre:|(|)'))'}{series_index:2s|[|] - }{title:|| - }{author_sort}
only work when series is empty? If I put the prefix and suffix anywhere else I get it for either field (series or genre) when I only want them for genre. The above produces a template error (invalid conversion specification) if the series exists.

Thanks.

ElfN

Last edited by Starson17; 06-06-2011 at 12:16 PM.
ElfN is offline   Reply With Quote
Old 06-06-2011, 07:53 AM   #8
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,443
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ElfN View Post
And why does
Code:
{series:'ifempty($,field('#genre:|(|)'))'}{series_index:2s|[|] - }{title:|| - }{author_sort}
only work when series is empty? If I put the prefix and suffix anywhere else I get it for either field (series or genre) when I only want them for genre. The above produces a template error (invalid conversion specification) if the series exists.

Thanks.

ElfN
The series template is using template-program mode, which has different rules from single-function mode. The parameter to field must be a column name and you must be careful where you put the quote that ends the program. I think you want
Code:
{series:'ifempty($,field('#genre'))'|(|)}{series_index:2s|[|] - }{title:|| - }{author_sort}
chaley is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kindle DX optimal "page" size - PDF or Word template guiyoforward Amazon Kindle 12 09-28-2010 07:05 PM
Changing "Save Template" not working? monkbythesea Calibre 10 08-04-2010 03:30 AM
template for "send to device" customization sbin Calibre 8 01-07-2010 07:22 AM
"perfect" epub model or template? gernblanston ePub 0 09-25-2009 11:00 AM
Help! the "Make Sony Reader File" under "Options" is different Dr. Drib Sony Reader 6 04-23-2007 02:56 AM


All times are GMT -4. The time now is 07:50 AM.


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