View Single Post
Old 09-09-2013, 12:43 PM   #13
redscarlett
Enthusiast
redscarlett began at the beginning.
 
Posts: 31
Karma: 10
Join Date: Jul 2013
Device: Nook Simple Touch Glowlight
Quote:
Originally Posted by chaley View Post
Taking a guess, the template would look something like
Code:
program: 
	c = field('#category');
	template1 = template('{#category}/{#sub_category}/{series}/{title}{series_index:0>4.1f}{authors}'), '');
	template2 = template('{#genre}/{#sub_genre}/{series}/{title}{series_index:0>4.1f}{authors}');
	first_non_empty(
		strcmp(c, 'Tort Law', '',  template1, ''),
		strcmp(c, "some other post grad category", '', template1, ''),
		template2
	)
The first template would be chosen if the category equals "Tort Law" or "some other post grad category". You would put a line into the template for each possible post-grad category.

For all the templates, if a value does not exist, it is replaced with nothing. This could leave two slashes adjacent to one another, which will be replaced by the template processor with one slash. Thus, when using template two when there isn't a series, without you doing anything the template effectively becomes
Code:
template('{#genre}/{#sub_genre}/title}{authors}');
Best I can do with the information I have.
Thank you!! That's brilliant
redscarlett is offline   Reply With Quote