US English (US)
BS Bosnian

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.

  • Book a Demo
  • Product Updates
  • Contact Us
English (US)
US English (US)
BS Bosnian
  • Home
  • Customization
  • 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, by David growhackscale

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.

  • Getting Started
    Users Accessibility New to Helpjuice? Start Here Content Management Multiple Languages/Translations & Localization Multilingual Knowledge Bases Analytics Video Tutorials
  • Customization
    Customization Guides
  • API V2
  • API V3 and Webhooks
  • Article Editor
  • Billing / Subscription
  • Authentication
  • Pricing
  • Swifty AI Chatbot
  • Swifty AI Helpbar
  • What's New
+ 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

  • Helpjuice's Template Engine
  • Shopify/Liquid Category Objects
  • Shopify/Liquid Complete Objects Reference

Copyright © 2025 - Helpjuice

Helpjuice, Inc. is a registered US Corporation, EIN # 45-2275731

Download W9
  • Help
  • Features
  • Pricing
  • About
  • Careers
  • Customers
  • Blog
  • Case Studies
  • Resources
  • Knowledge Base Examples
  • Privacy Policy
  • Terms of Service

Why is the knowledge base important?

With a knowledge base, you can allow your customers to self-help themselves, thus reducing your customer support by up to 60%. Furthermore, you can also have your team get instant answers to the questions they need without having to email themselves all using knowledge base software.

What is the purpose of a knowledge base?

The purpose of knowledge base software is to allow you to host your knowledge base/corporate wiki in one centralized 'hub'. Both your customers, and employees can now access information within seconds!

Made with from Miami, Bosnia, Morocco & Brasil

+1 (833) 387 3877 support@helpjuice.com
Expand