We’re setting up a number of templates for use in post-purchase flows. Some of these templates have conditional statements within the markup that determine what text to show. Here is an example:
{% if person|lookup:'hs_cust_id' > 0 %} <p>SOME MARKUP FOR PPL WITH THAT CUSTOM FIELD</p> {% else %} <p>Default markup</p> {% endif %}
See that > above? That’s supposed to read ‘{% if person|lookup:'hs_cust_id' > 0 %}’ but every time I (or someone else on the team) makes a change to the template, it auto-escapes it to > .
This happens whether it’s me editing the source code, or someone else using the rich text editor.
Tried to workaround by changing to: {% if person|lookup:'hs_cust_id' >= 1 %}...but you can see what it did to >=.
I’m going to rewrite the template by using the show/hide logic on the ‘Display’ tab for the section, as that doesn’t get auto-formatted, but could this be raised as an issue?
Use this filter to return the value of the expression "item is greater than value" (item > value) where item is passed first and value is passed second.
{% if 3|gt:2 %}
<p>3 is greater than 2</p>
{% endif %}
{% if 2|gt:3 %}
<p>2 is greater than 3</p>
{% endif%}
gte
Use this filter to return the value of the expression "item is greater than or equal to value" (item >= value) where item is passed first and value is passed second.
{% if 2|gte:2 %}
<p>2 is greater than or equal to 2</p>
{% endif %}
{% if 1|gte:2 %}
<p> 1 is greater than or equal to 2</p>
{% endif %}
lt
Use this filter to return the value of the expression "item is less than value" (item < value) where item is passed first and value is passed second.
{% if 2|lt:3 %}
<p>2 is less than 3</p>
{% endif %}
{% if 3|lt:2 %}
<p>3 is less than 2</p>
{% endif %}
lte
Use this filter to return the value of the expression "item is less than or equal to value" (item <= value) where item is passed first and value is passed second.
Use this filter to return the value of the expression "item is greater than value" (item > value) where item is passed first and value is passed second.
{% if 3|gt:2 %}
<p>3 is greater than 2</p>
{% endif %}
{% if 2|gt:3 %}
<p>2 is greater than 3</p>
{% endif%}
gte
Use this filter to return the value of the expression "item is greater than or equal to value" (item >= value) where item is passed first and value is passed second.
{% if 2|gte:2 %}
<p>2 is greater than or equal to 2</p>
{% endif %}
{% if 1|gte:2 %}
<p> 1 is greater than or equal to 2</p>
{% endif %}
lt
Use this filter to return the value of the expression "item is less than value" (item < value) where item is passed first and value is passed second.
{% if 2|lt:3 %}
<p>2 is less than 3</p>
{% endif %}
{% if 3|lt:2 %}
<p>3 is less than 2</p>
{% endif %}
lte
Use this filter to return the value of the expression "item is less than or equal to value" (item <= value) where item is passed first and value is passed second.
@saulblum@Kim Strauch thanks both for the helpful replies. Was able to use |gt:0 to get the template to work as we wanted (although marketing have since changed the flow logic anyway so we won’t be using it now). I’ll note down the filters for future use, as this’ll definitely come up again.