View Single Post
Old 05-20-2014, 03:45 PM   #4
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)
Glad I could help! I'd like to point out that in template program mode, which we used, the fieldname at the beginning is optional. But if available, you can represent it with "$".

It isn't
Code:
{title:'current_library_name()'}
it is
Code:
{:'current_library_name()'}
You know what the next big step is, don't you... I mean, if you're going to insist on using the full capabilities and everything...

General Program Mode!!!

Much cooler! And personally I think it's easier than applying functions to templates.

For your final template, this is what it would look like.

Code:
program:

# if in fanfic library, use first available fandom
# else use the author
first_fandom = 
	contains(
		current_library_name(),
		"^Fanfiction Library$",
		sublist(
			field(
			"#fandom"),
			0,
			1,
			","
		),
		field("authors")
	);

# add together each section of the template
strcat(
	current_library_name(),
	"/",
	first_fandom,
	"/",
	field("title")
);

Last edited by eschwartz; 05-20-2014 at 04:32 PM. Reason: with chaley's change
eschwartz is offline   Reply With Quote