Quote:
Originally Posted by maddz
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'
|
Putting aside the newlines, this template does what the above says you want. There might be some misspellings in the column lookup names as I don't have those columns in my database.
Code:
{#subseries}{#subseries_index:| | - }{#myshelves}{#hugonominees:| - |}
I tested it with columns I have:
Code:
{#series}{#series_index:| | - }{#genre}{tags:| - |}
EDIT:
According to this post I tested newlines in the subtitle and they didn't work. The the template below isn't useful.
This GPM template does the same thing except for using newlines instead of the minus signs.
Code:
program:
# This template produces a 1-to-3 line result.
# The first line is the subseries if there is one.
# The next line is the shelves, which are always present.
# The last line is the hugo nominees, if there is one.
if $subseries then
ss = $#subseries & ' ' & $#subseries_index & character('newline')
else
ss = ''
fi;
if $#hugonominees then
hugo = character('newline') & $#hugonominees
else
hugo = ''
fi;
return ss & $#myshelves & hugo
NB: I left off some of the '#' characters in the template in my last post. I tested it with columns that exist then incorrectly edited it to reference your columns.