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.