View Single Post
Old 05-24-2025, 04:58 AM   #3
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,465
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
When asking questions about templates it is generally useful to include the templates.

Code:
{if(1, 'SUCCESS', 'FAILURE')}
This is not a valid template in any mode. As I don't know what you are trying to do I can't comment further.

Quote:
AND THEN when attempting to define a custom Python template function (field_exists) in Preferences → Advanced → Template functions I got this error:

"EXCEPTION: Formatter: if statement: expected 'then', found 'is' near 'mi' on line 2"
This says the template is not in Python Template Mode but is instead in General Program Mode. Again, without seeing the template I can't comment further.

EDIT: The calibre template language manual might be useful.

Last edited by chaley; 05-24-2025 at 06:23 AM.
chaley is offline   Reply With Quote