Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I need document write about Liquid variable.
I read following document, but there is not enough information for me.
https://shopify.dev/docs/api/liquid/basics#referencing-handles
Where is it write about more detail about Liquid variable?
I'd like to know detail about variable key in square bracket like `var["key"]`.
1. Is it possible to use backslash escape like `var["key-with-quote\""]` ?
The Ruby library liquid gem, it occur syntax error when using backslash escape.
Is this behavior a bug or specification?
2. Some characters have special meaning in the variable key?
The Ruby library liquid gem, it handle `item["key]"]` as `item[key]`.
I expected the key `"key]"` is literal string, but library handle as variable `key`.
Is this behavior a bug or specification?
The Ruby library liquid gem(v5.4.0), it handle `item["item['key']"]` as `item[item["key"]]`.
But unreleased version (master branch) handle `item["item['key']"]` as `item["item['key']"]`.
I expected the key `"item['key']"` is literal string, but the library of released version handle as variable `item['key']`.
Which behavior is right?
----
I also posted to GitHub Issue.
Should I refer to liquidjs (npm) instead of liquid gem?
Which Liquid implementation is correct?
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025