Quote:
Originally Posted by chaley
As said in the calibre template documentation, don't use subtemplates Single Function Mode.
Are you are referring to the last expression?
Code:
{#hugonominees:|| - {#hugonominees}}
The expression doesn't make sense to me. It appears to be trying to include #hugonominees twice, with a hyphen between them. And again, the subtemplate shouldn't be used.
I think you want
Code:
{#hugonominees:| - |}
The character() function works only in General Program Mode.
I think this GPM template gets close to what you want.
Code:
program:
# This template produces a three line result.
# Line 1 is the subseries, or - if there isn't one.
# Line 2 is the shelves, or '-' if there aren't any
# Line 3 is the hugo nominees, or '-' if there aren't any
ss = $subseries;
ssi = $subseries_index;
if ss then
ss_res = ss & ' - ' & ssi
else
ss_res = '-'
fi;
shelves = ifempty($#myshelves, '-');
hugo = ifempty($hugonominees, '-');
return ss_res & character('newline') & shelves & character('newline') & hugo
|
The expression is used in the Kobo Utilities output plugboards to define the output to the Subtitle field. I think it was Davidfor who helped me to set it up initially because of the problems with sorting braided series (I use a main series with the index as the internal chronology, and the subseries is added as appropriate; if you include the subseries in the series output, it doesn't sort properly - all entries with a subseries sort to the end of the list).
The || is to suppress the function if there is no entry in the field prior to || (so I don't get " - My Shelves" if there is no entry for a subseries but I get just "My Shelves" instead). I output 'My Shelves' so I can see at a glance if a particular series is split across multiple shelves - which has happened - so I know to update Calibre to correct the error. Given I have 6700+ ebooks collected since the early 2000s, eyeballing the Calibre list makes for easily missed inconsistencies. It's been cleaned up over the years though, so eventually I'll drop that section of the plugboard.
What it's doing is if there are entries in all 3 fields is producing the output:
'Subseries' 'Subseries Index' - 'My Shelves' 'Hugo Nominations'
What I want it to do is produce:
'Subseries' 'Subseries Index' - 'My Shelves'
- 'Hugo Nominations'
Ideally, it should be:
'Subseries' 'Subseries Index'
'My Shelves'
'Hugo Nominations'
But I am not sure if the subtitle field can take more than one line...
If there is less than three entries (every title will have 'My Shelves'), the line breaks for the subseries and Hugos should be suppressed, so there is either 1 line or 2 lines:
'My Shelves'
or
'Subseries' Subseries Index'
'My Shelves'
or
'My Shelves'
'Hugo Nominations'
I hope this makes sense! I'm fiddling with the output now, as I am trying to prioritise my reading; some novels from the packet are in the Best Editor nominations, and they are low priority, so I want to see which unread title to go for first.