Liquid Programming Annoyances (and Workarounds)

,

Cannot combine contains and other logical tests Annoyance: This doesn’t work: Solution: You have to nest your conditionals — first check the contains, then make your other checks Type Casting Liquid is loosely typed, which usually makes things simple, if sometimes unpredictable. Annoyance: you don’t need to declare a variable as a string or integer, […]

Shopify Breadcrumbs Based on Menu Structure (Improved Version)

,

A couple of years ago, I wrote about how to create breadcrumbs for products that would mirror the main menu of a Shopify site. In reality, that was a quick and dirty method that I had to quickly update a month later, but never got around to writing up the better version. As I noted […]

Multi-Dimensional and Associative Arrays in Shopify Liquid

,

I know. You’re here because you’re sure you’re missing something. You can’t figure out how to create multi-dimensional and associative arrays in Shopify. Sadly, you’re not missing something. In fact, while you can access multi-dimensional arrays just fine, you can’t assign values to them. Similarly you can access objects with named members that have values […]

Syntax Highlighting for Liquid

,

I wanted to publish a blog post today about using Shopify menus to drive hierarchical breadcrumbs. Then I realized that, as near as I can tell, there is nobody who has a syntax highlighter for Liquid, the templating language that Shopify uses. So I created one. This is an pre-pre-alpha experimental plugin, but it’s working […]

Shopify Breadcrumbs based on Menu Structure

,

Shopify breadcrumbs can be hard because there’s no way to organize them by default and Shopify has no way to establish a parent-child relationship between collections. But you can use your menu structure to create just such a relationship to build intelligent breadcrumbs. Here’s how!