Resolving Template and Liquid Errors in ABOSS
โ
When creating custom contract or invoice templates, you may encounter a template error or liquid error. These errors indicate issues in your code that prevent the system from processing the template correctly. This article will guide you through the most common errors and how to fix them.
Table of Contents
Liquid Syntax Error: 'for' Tag Not Closed
Liquid Syntax Error: 'if' Tag Not Closed
Liquid Syntax Error: Variable Not Properly Terminated
Liquid Error: Unknown Operator =
1. Liquid Syntax Error: 'for' Tag Not Closed
This error occurs when a for-loop is started but not properly closed.
Example of Incorrect Code:
{% for e in events %} {{ e.fee }}
The for-loop is incomplete and will cause a syntax error.
Correct Code:
{% for e in events %} {{ e.fee }} {% endfor %}
2. Liquid Syntax Error: 'if' Tag Not Closed
Similarly, an if-statement must be properly closed to function correctly.
Example of Incorrect Code:
{% if event.fee > 0 %} {{ event.fee }}
This if-statement is missing the closing tag, which will cause an error.
Correct Code:
{% if event.fee > 0 %} {{ event.fee }} {% endif %}
3. Liquid Syntax Error: Variable Not Properly Terminated
This error occurs when a variable is not properly closed with {{ and }}. Any missing bracket will cause an error.
Example of Incorrect Code:
{{ contact.contact_name }
In this example, the closing bracket } is missing.
Correct Code:
{{ contact.contact_name }}
4. Liquid Error: Unknown Operator =
In if-statements, you must use the comparison operator == rather than a single =, which will cause an error.
Example of Incorrect Code:
{% if event.fee = 0 %}
This code will result in an error due to the incorrect operator.
Correct Code:
{% if event.fee == 0 %}
If you encounter any other errors or need further assistance, feel free to contact ABOSS Support for help.