View Single Post
Old 05-05-2024, 11:51 AM   #143
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: 11,765
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by capink View Post
Code:
{series:ifempty({authors})}/{title} - {authors}
Subtemplates don't work reliably in single function mode (SFM) because they are interpolated before the arguments are parsed, meaning the content will be parsed as arguments.

Better would be this in template program mode (TPM):
Code:
{series:'ifempty($, $authors)'}/{title} - {authors}
I suggest that the template should use only the first author to avoid path length problems. This one does that using both TPM and SFM
Code:
{series:'ifempty($, list_item($authors, 0, '&'))'}/{title} - {authors:list_item(0,&)}

Last edited by chaley; 05-05-2024 at 11:54 AM. Reason: Added links to the manual
chaley is offline   Reply With Quote