View Single Post
Old 11-10-2015, 06:58 PM   #701
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Single template that does it all for you.

Code:
program:

prefix_if_series = strcat(
	field('series'),
	' - (',
	field('publisher'),
	')/[',
	field('series_index'),
	'] - '

);

final = strcat(
	test(
		field('series'),
		prefix_if_series,
		''
	),
	field('title'),
	' - ',
	field('authors')
);

Explanation: You want "title - authors", and IF there is a series, you want the series and publisher info in front.

So, first we calculate what all that extra information in front should be.
In the form:
Code:
series - (publisher)/[series #] -
Then, test to see if series has content.
If so, prepend the calculated extra information.
If not, prepend an empty string, i.e. nothing.

Finally, add the:
Code:
title - authors

Last edited by eschwartz; 11-10-2015 at 07:04 PM.
eschwartz is offline   Reply With Quote