Ad

Shopify Liquid Javascript Parsing

- 1 answer

I'm new to Shopify and i'm trying to wrap my head around the following. I know that the liquid templating engine parses the javascript on the Shopify servers.

Is there a way to prevent this? For instance i have a variable to configure my interpolation delimiter like so :

    var delimiters = ['{{', '}}']

After it gets parsed it looks like this:

    var delimiters = ['', '']

My javscript doesn't like this. I have a workaround to change the delimiter into something the parsing engine ignores but i was wondering if i could prevent the parsing completely (for my javascript files).

If anyone knows i would appreciate any information.

Thank you in advance.

Ad

Answer

If you don't want to parse something, enclose it within {% raw %} {% endraw %} tags.

Ad
source: stackoverflow.com
Ad