View Single Post
Old 01-02-2024, 10:38 AM   #5
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,511
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
I suggest that you look at the General Program Mode template language documentation, and also use other templates as a pattern, such as the one I provided in a previous post.

The template you provided:
Code:
program:
if series_sort then
template (series/{author_sort[0]}/{author_sort}/{series}/{series_index:0>3s} - {title}/{author_sort} - {series} - {series_index:0>3s} - {title})
else
template ( single books/{author_sort[0]}/{author_sort:sublist(0,1,&)}/{title}/{author_sort} - {title})
is not sytactically correct. It is missing many quotes that delimit strings and is missing the final "fi" of the if-then-else statement. I also don't know why you are using "if series_sort". I suspect you mean "if series_sort()", but that does the same thing as "if $series" but more slowly.

Here is a corrected version that runs.
Code:
program:
	if $series then
		template('series/{author_sort[0]}/{author_sort}/{series}/{series_index:0>3s} - {title}/{author_sort} - {series} - {series_index:0>3s} - {title}')
	else
		template('single books/{author_sort[0]}/{author_sort:sublist(0,1,&)}/{title}/{author_sort} - {title}')
	fi
chaley is offline   Reply With Quote