Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Contact Us
  • Home
  • Customization Guides
  • Liquid Templating Basics

Shopify/Liquid Filter Syntax

How to use filters on objects and on logic statements

Written by Guilherme Arantes

Updated at August 25th, 2020

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Customization
    Customization Guides
  • Article Editor
  • Getting Started
    Managing Users Analytics Content Management Permissions & Accessibility Video Tutorials
  • Integrations
  • API & Webhooks
    API V2 API V3
  • Languages & Translations
  • Authentication
  • Swifty AI
  • Settings
    User Settings User Behavior Knowledge Base Settings Custom Domain
+ More

Every time you need to limit a loop statement or change the output of an object value, you can rely on Liquid Filters.


Limit filter

The following example is the same example found in the Shopify/Liquid Logic Syntax page‍ plus the limit filter:

<ul class="top_categories">
{% for categories in roots_categories | limit: 5 %}
  <li class="category_item">
    <a href="{{ category.url }}" class="category_link">{{ category.name }}</a>
  </li>
{% endif %}
</ul>

Notice that we added the limit filter on the For Statement syntax:

{% for categories in roots_categories | limit: 5 %}

Now, the category list has 5 maximum items. It can be smaller but it cannot display more than 5 items.


Size filter

The size filter will output the size of the object value if it's a string or the length of a list:

{% question.name | size %}

The above example would output the size of the question name.

{% if category.questions.size > 10 %}
  <p>There are more than 10 questions in this category!</p>
{% else %}
  <p>There are 10 or less questions in this category.</p>
{% endif %}

Notice that the size filter can be use as an object attribute on a logical statement:

{% if category.questions.size > 10 %}{% endif %}


Downcase filter

The downcase filter will convert the string to downcase:

{{ "Getting Started" | downcase }}

The above example would output:

getting started


All Liquid Filters

The official Shopify/Liquid documentation has a complete filters guide on its docs page.


Objects List

You can find the complete object reference at Shopify/Liquid Complete Objects Reference‍.


Advanced Shopify/Liquid Syntax

You can find more information about Logical Statements on the official Liquid documentation. The complete Shopify/Liquid documentation is located here.

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • Shopify/Liquid Complete Objects Reference
  • Shopify/Liquid Category Objects
  • Helpjuice's Template Engine
One Knowledge Base To Replace Them All
24/5 support
Constant Product Updates & Improvements
100% money back guarantee
99.9% Uptime
Features
  • AI Knowledge Base AI-Enabled
  • Helpjuice Extension AI-Enabled
  • Powered Editor AI-Enabled
  • Advanced Analytics AI-Enabled
  • Customizable Themes AI-Enabled
  • Swifty · Helpbar & Chatbot AI-Enabled
  • Multi-Language Support
  • Step-by-Step Tutorial Creator
  • Seamless Integrations
  • User Access Control
  • See All Features >>
Product
  • Product Roadmap
  • Pricing
  • Book a Demo
  • Policies & Security
  • Our Customers
  • About Helpjuice
  • Contact Our Team
Resources
  • Our Knowledge Base
  • Webinars
  • Success Stories
  • API Documentation
  • Data Import Guide
  • Helpjuice Blog
Copyright © 2025, Helpjuice Inc.
Helpjuice, Inc. is a registered US Corporation.
EIN 46-2257741 | Download W9
Made in America High Performer Ease of Use Get Support
Get Started For Free
4.8 average review on
Life’s too short to use mediocre software.
+1 (833) 387 3877
Powered by Helpjuice Helpjuice Swifty AI External Link
Expand