What Else Does Liquid Offer In Shopify App


In terms of Liquid Tags in shopify, besides the for tag, there are several others. Th most common ones are:
Comment:

{% comment %} This text will not be rendered {% endcomment %}

If/Else:
view plaincopy to clipboardprint?

{% if product.description == “” %}
This product has no description!
{% else %}
This product is described!
{% endif %}

Case:

{% case template %}
{% when ‘product’ %}
This is a product.liquid
{% when ‘cart’ %}
This is a cart.liquid
{% endcase %}

Check out the full list of Tags in shopify.

Liquid also offers plenty of filters you can use to massage your data. Some common ones are:
Capitalize:
view plaincopy to clipboardprint?

{{ “monday” | capitalize }} #=> Monday

Join:
view plaincopy to clipboardprint?

{{ product.tags | join: ’, ’ }} #=> wooden, deep snow, 2009 season

Date:
view plaincopy to clipboardprint?

Posted on {{ article.created_at | date: “%B %d, ’%y” }} #=> Posted on January 26, ’09

Advertisements