Ad
Shopify Liquid Javascript Parsing
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
Related Questions
- → How to update data attribute on Ajax complete
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → Octobercms Component Unique id (Twig & Javascript)
- → Passing a JS var from AJAX response to Twig
- → Laravel {!! Form::open() !!} doesn't work within AngularJS
- → DropzoneJS & Laravel - Output form validation errors
- → Import statement and Babel
- → Uncaught TypeError: Cannot read property '__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED' of undefined
- → React-router: Passing props to children
- → ListView.DataSource looping data for React Native
- → Can't test submit handler in React component
- → React + Flux - How to avoid global variable
- → Webpack, React & Babel, not rendering DOM
Ad