View Single Post
Old 09-19-2014, 02:11 AM   #574
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,471
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by eschwartz View Post
Everything after the ":" is a modifier. The "|stuff|stuff" are prefixes and suffixes for the parent template (in this case, series) -- as you can see, you already have one for series_index.

This allows for making stuff dependent on the parent template existing. So. I simply moved the space and dash to be dependent on the series field not being empty.
FWIW: you can use the finish_formatting function instead of the template and test to format it and add the spaces and brackets. Something like
Code:
s_index = finish_formatting(field('series_index'), '.2f', ' [', ']'))
chaley is offline   Reply With Quote