01-10-2011, 08:36 PM | #1 |
Fat Guy
Posts: 408
Karma: 24165
Join Date: Jun 2010
Device: Kindle Voyage
|
Plugboard Question
So I modified one of the plugboard suggestions (from the sticky) slightly, so that the title of the book goes first, followed by a delineating character, followed by series info. Here's the plugboard formula:
{title} | {series:|| }{series_index:0>2s|[|]} Here's sample output: A Game of Thrones | A Song of Ice and Fire [01] This is great (Thanks to everyone involved!), except for one little thing: when sending a single book (ie, not part of a series), I get this: Book Title | My question is, is there a method to make that delineating character conditional upon there actually being a series in the metadata? If so, pointers would be greatly appreciated. |
01-10-2011, 09:24 PM | #2 |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
You need to bring the delineated char inside the {series} part so that it only appears when {series} is not empty.
If you could live with using a dash rather than a vertical bar as the delineating char this would work: Code:
{title}{series:| - | }{series_index:0>2s|[|]} A Game of Thrones - A Song of Ice and Fire [01] This is because the vertical bar has a special meaning in the template language. There may be a way to get exactly what you want but I'm not sure how. |
Advert | |
|
01-11-2011, 03:49 AM | #3 | |
Grand Sorcerer
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
In template program mode, use: Code:
{title}{series:'test($, ' | ','')'}{series} {series_index:0>2s|[|]} Code:
program: strcat( field('title'), test(field('series'), ' | ', ''), template('{series} {series_index:0>2s|[|]}') ) |
|
01-11-2011, 01:34 PM | #4 |
Fat Guy
Posts: 408
Karma: 24165
Join Date: Jun 2010
Device: Kindle Voyage
|
Jackie, thanks for taking the time to help me.
Chaley, I went with your template program mode version, which, of course, worked perfectly. Thanks a ton for taking the time to write that for me. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
metadata plugboard functions? | mfaine | Calibre | 2 | 01-09-2011 05:37 AM |
K3 plugboard basics | jackie999 | Calibre | 13 | 12-13-2010 03:48 AM |
Metadata Plugboard - First Char of each word in Series | MikeP1212 | Calibre | 2 | 10-14-2010 06:14 PM |
PRS-505 Getting Authors to sort by last name using Calibre's metadata plugboard. | ligelowbee | Sony Reader | 5 | 10-14-2010 12:06 PM |
Problem with Metadata Plugboard | cheveguerra | Calibre | 3 | 10-05-2010 12:00 PM |