07 août 2023

Liquid template language: The foundation of Shopify themes

Prêt à booster votre e-commerce Shopify ?
Réservez votre consultation gratuite de 30 minutes avec nos experts

The Liquid template language is a markup language used by Shopify to create custom and dynamic themes. Developed by Shopify, it is similar to template languages like EJS files in Node.js or Twig files in PHP.

Liquid works by integrating tags, objects, and filters directly into HTML, allowing it to retrieve dynamic data from the store. Here is a more detailed description of its components:

  1. Tags: These allow for control of logical flow, including loops and conditions. For example:
    • {% if product.available %} - checks if a product is available.
    • {% for product in collections.frontpage.products %} - iterates through products in a collection.
  2. Objects: Used to display data content from your Shopify store. For example:
    • {{ product.title }} - displays the product's title.
    • {{ shop.name }} - displays the store's name.
  3. Filters: These allow you to modify the output of text, numbers, dates, etc. For example:
    • {{ product.price | money }} - formats a price using the store's currency format.
    • {{ "a string" | upcase }} - converts text to uppercase.

A relevant anecdote to illustrate the use of the Liquid template language is that of Jane, a store owner who wanted to creatively display customer reviews on each product page. She used tags to check if reviews were available, objects to retrieve the details of each review, and filters to format the review dates. For example, she used: {% if product.reviews.size > 0 %} to check review availability, and {{ review.content | escape }} to display the content, while ensuring special characters were properly escaped. Thanks to Liquid, Jane was able to offer a dynamic and attractive presentation of each review, thus increasing the credibility of her products and the satisfaction of her customers.

To learn more about the Liquid template language, you can consult the official Shopify documentation or contact a specialized Shopify agency to assist you with your projects.

Prêt à booster votre e-commerce Shopify ?
Réservez votre consultation gratuite de 30 minutes avec nos experts
Photo de POHL

L'AUTEUR

Florian POHL

Co-fondateur de Stellar Projects, Florian incarne une double expertise rare : la maîtrise du design technique et une compréhension fine des leviers marketing. Avant de co-fonder l’agence, il a lancé plusieurs marques en ligne à succès, ce qui nourrit aujourd’hui sa capacité à concevoir des sites Shopify à la fois beaux, performants et pensés pour vendre. Chez Stellar, il pilote la création et la technique avec un seul objectif : transformer chaque projet en accélérateur de croissance. Florian est également co-auteur du livre "Créer sa marque à l'ère de l'IA", publié en 2026.

Votre site doit vendre, pas juste exister

Réservez 30 minutes avec un expert Shopify pour identifier vos leviers de croissance réels.