Book Image

Shopify Theme Customization with Liquid

By : Ivan Djordjevic
Book Image

Shopify Theme Customization with Liquid

By: Ivan Djordjevic

Overview of this book

Shopify is one of the fastest-growing eCommerce platforms, which means developers familiar with the Liquid concept are needed now more than ever. This book will help you to build a solid foundation by enabling you to develop your skills from the ground up by gaining essential theoretical knowledge of Liquid and putting that knowledge to use through hands-on projects. Shopify Theme Customization with Liquid begins by helping you get to grips with basic Shopify information, its interface and theme structure, setting up your Partner account, and creating a child theme, which is essential when preparing for any future work on Shopify. You'll then explore Liquid core features that will provide you with a basic understanding of the Liquid programming logic needed to develop any feature. As you advance to the latest and advanced features, you'll learn about JSON settings, allowing you to create any type of static or dynamic section - a must-have for becoming a competent Shopify developer. Finally, the book takes you through the Shopify Ajax API to gain the necessary skills needed to create a variety of dynamic features and content. By the end of this Shopify book, you'll be able to take on challenging projects to showcase your theme customization expertise to your future employer.
Table of Contents (15 chapters)
1
Section 1: Shopify Explained
4
Section 2: Exploring Liquid Core
8
Section 3: Behind the Scenes
Appendix: Frequently Asked Questions

Variable tags

We can consider variables as data containers to save the various types of information that we want to use later in our code or overwrite as needed. Besides saving the information for later use, variables also allow us to use descriptive text as a label, allowing us to understand what type of information a particular variable contains. We can divide the variable tags into the following four groups:

  • assign
  • capture
  • increment
  • decrement

The assign tag

The assign tag allows us to declare a variable to which we can assign string, number, or Boolean data. We can declare a variable by writing the assign keyword followed by the name of the variable we are declaring, followed by the equal sign and the date we assign to that particular variant, and encapsulating it within the curly brace delimiters with percentage symbols:

{% assign stringVar = "This is a string!" %}
{% assign numberVar = 2021 %}
{% assign booleanVar = true %}

Once we...