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

What this book covers

"Share Your Thoughts" on page xvi, Getting Started with Shopify, creates a solid foundation for understanding what Shopify is, how it all works, and other essential knowledge that, as practice shows, is often skipped. The approach of cutting the theoretical and jumping straight into the syntax might sound tempting, but as we all know, even the tiniest ripples can cause considerable problems in the future. While we will not go much into how Toby Lütke created Shopify, we will cover some essential topics, including creating a private development store, creating a child theme, explaining theme structure, and other essential topics that we need to know.

Chapter 2, The Basic Flow of Liquid, helps us learn what Liquid is and how to write it by explaining the Liquid syntax. We will also go over logical and comparison operators, what types of data we can use within Liquid, what handles are, and other essentials. By learning how to use logical operators and manipulate handle attributes, we will also learn how to combine them to create various dynamic features.

Chapter 3, Diving into Liquid Core with Tags, covers programming logic, or in short, tags. There are many types of tags, such as control flow tags, which allow us to output a block of Liquid code based on various conditionals through iteration tags that will repeatedly run a block of code. Additionally, we will learn about the different types of variable tags we can use to store data, as well as theme tags that will allow us to render theme-specific tags.

Chapter 4, Diving into Liquid Core with Objects, helps us understand what content objects are, why they are mandatory, and how to use them, which is the first step in creating future templates. After that, we will move to global objects, the knowledge of which will open a new door for us and output our dynamic content on any page. Lastly, we will learn what metafield objects are and utilize them to output unique content on any page.

Chapter 5, Diving into Liquid Core with Filters, is a crucial topic of Liquid core, which will allow us to create or manipulate different types of data, which is a compelling feature. With Liquid filters, we will gain a more profound knowledge of how Liquid works and how easily we can output dynamic data such as the image HTML tag, calculating the product discount, and handling font variants.

Chapter 6, Configuring the Theme Settings, helps us learn about JSON settings and why these files are so important to us. Later, we will move to a more direct approach to the topic by learning what types of settings we can use inside our JSON files and the difference between the basic and specialized input settings.

Chapter 7, Working with Static and Dynamic Sections, will help us understand what sections are and how to use them to create easily configurable content through the Shopify theme editor. We will learn how to create static and dynamic sections and their counterpart blocks, which play a considerable role in theme development. Lastly, we will learn more about the newly introduced JSON-type templates and how we can combine them with metafields to create genuinely unique and easily configurable content on any page.

Chapter 8, Exploring the Shopify Ajax API, takes us through the Shopify Ajax API and explains its requirements, limitations, and possible use cases. Additionally, we will learn how to make different types of requests to the Shopify API. We will learn how to retrieve product information, add any number of products to the cart session, and read the cart's current content. Lastly, we will learn how to make a request through the Shopify API and retrieve the necessary information to create the product recommendation and predictive search feature.

Appendix, Frequently Asked Questions, contains additional guidelines, advice, and answers to the questions common for developers who are just getting started on entering the world of Shopify and Liquid.

Assessments, contains the answers to the questions from all the chapters.