Quote:
Originally Posted by chaley
This avoids any extraneous periods by including a preceeding dot only if the column has a value:
Code:
{#titlecount:}{#pagecount:|.|}{series:|.|}{#pubseries:|.|}{#pubseries_index|.|}
However, I prefer this GPM template that (I think) makes the intentions explicit.
Code:
program:
list_join('.', $#titlecount, '.', $#pagecount, '.', $series, '.',$#pubseries, '.', $#pubseries_index, '.')
The above can be written as a TPM template if it is embedded with other template expressions:
Code:
{:'list_join('.', $#titlecount, '.', $#pagecount, '.', $series, '.',$#pubseries, '.', $#pubseries_index, '.')'}
|
How about
Code:
program:
'.'.join(filter(None, ($#titlecount,$#pagecount,$series,$#pubseries,$#pubseries_index)))
? I
think this should make a string concatenating only the non-None values in the list, and prevent leading or trailing '.'.