Data Types: String Number Boolean Nil Array EmptyDrop in Shopify

When it comes to a website, data is the first thing you come up with. Shopify is built based on Liquid language. Therefore, this tutorial today aims to give you profound introduction to Liquid template and explain types of Liquid data.

Table of content

Overall about Liquid template

A language template is a website language that web designers use to build website combined with static content and dynamic content. The former is the same on multiple pages and the later changes from one page to the next. Liquid is a template language that Shopify uses.

Liquid is now available as an open source project on GitHub and used by a lot of websites and companies. Liquid is suitable for uploading dynamic content on websites.

Types of Liquid

Liquid has five main types: String, Number, Boolean, Nil and Array. Each type will be presented in the next parts.


In Liquid template, you declare a string by grouping variable’s value in single or double quotes. For example, you insert my_string after a call order assign to announce a string name Hello World.

{% assign my_string = "Hello World!" %}


Number allows you to add numbers or integers in the code. For instance, you include the size of int.

{% assign my_int = 25 %}
{% assign my_float = 39.756 %}


Boolean in a Liquid type that give answer to true or false. There is no quotations when you declare a boolean.

{% assign foo = true %}
{% assign bar = false %}


Nil is the most special type of Liquid language. Nil is an empty value which is returned when Liquid code has no result.

Nil gives false result in case that if blocks and other Liquid tags that check the truthfulness of statement.

In the example below, unless the user exists (that is, user return nil), Liquid will not print the greeting:

{% if user %}
  Hello {{ }}!
{% endif %}

Tags or outputs that return nil will not be displayed on the front page.


The current user is {{ }}


The current user is


Array is used the most in Liquid language template. Array can hold lists of variables of any type. You can access any items or specific items in array.

Accessing items in array

You go through each item in the array using an iteration tag which runs blocks of code repeatedly such as for, cycle, tablerow to access all items in an array.


<!-- if site.users = "Tobi", "Laura", "Tetsuro", "Adam" -->
{% for user in site.users %}
  {{ user }}
{% endfor %}


Tobi Laura Tetsuro Adam

In order to access a specific item, you use square bracket notation.


<!-- if site.users = "Tobi", "Laura", "Tetsuro", "Adam" -->
{{ site.users[0] }}
{{ site.users[1] }}
{{ site.users[3] }}




In a nutshell, this tutorial continues to give you a brief introduction to Liquid template. Liquid has five main types: string, boolean, number, array and nil. Each type assists you in uploading dynamic content on the front page. We hope that you will find something useful in this tutorial.

Recommend for you
Image Description
SEO Suite [FREE]

Auto-optimize website elements and structure in one-click.

Learn more
Proofo - Social Proof [FREE]

Use Social proof to boost sales

Learn more
Image Description
Size Chart [FREE]

Stunning size guide for great shopping experience

Learn more
Image Description
Free Shipping Bar [FREE]

Increase customers’ shopping cart size with free shipping offer

Learn more

Comments for Data Types: String Number Boolean Nil Array EmptyDrop


Stay in the know

Get special offers on the latest news from AVADA.

40k subscribers has been joined!

Earn $10 in reward now!

go up