How to comment out liquid code

17 0 0



I would like to comment out some code in the product-template.liquid and have read that its done with

{% comment %} and {% endcomment %}

However, when I apply it to my code:

{% comment %} {% form 'product', product, class:productform_class %}{% endcomment %}

I get an error:

Line 202 — Liquid syntax error: 'endcomment' is not a valid delimiter for form tags. use endform

Does anyone know what the issue and how to resolve it?


Many thanks


Reply 1 (1)
New Member
1 0 0

The issue is probably resolved by adding a "-" (dash) after and in front of the % signs, so:

{%- comment -%} and {%- endcomment -%}