Code to select or not a text

I want to insert a check box.
If the check box is marked, a specific text will be applied.
if the check box is not marked, the text will not be displayed.

What is the code ?

Hey @Birgit,

How a check box works is explained here:

You’ll have to create an if-statement that, when the checkbox is marked (which causes the value of the checkbox being “true”), text needs to appear, which is explained here:

Can you try with this? If stuck, be sure to show your code so we can help you further.

I entered this code

{% input custom.check.done as:boolean %} WCO
{% if custom.check.done =“true” %}
III. Melding WCO

{% endif %}

and it gives:
Liquid error (line 36): Unknown operator =

Hey @Birgit,

Almost there :+1:

The error “Unknown operator =” actually means the = is incorrect for your if-statement.
More info on operators and more particularly the equal-statement here:

Your code should work like this:


{% input custom.check.done as:boolean %} WCO
{% if custom.check.done == “true” %}
III. Melding WCO

{% endif %}

Care to give it another try? Let us know if it worked!

ok, it works