Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of the global Shopify template variable sometimes causes conflicts. #19

Open
VeeDoubleYuh opened this issue Nov 11, 2019 · 1 comment · May be fixed by #18
Open

Use of the global Shopify template variable sometimes causes conflicts. #19

VeeDoubleYuh opened this issue Nov 11, 2019 · 1 comment · May be fixed by #18

Comments

@VeeDoubleYuh
Copy link

Hi there,

There is an issue where the template variable in the shortcode code can override other uses of this global variable in other code.

For example, our site is using s-template-{{ template.name | handle }} to set a class on the body of every page to determine what template is being loaded. We ran into an issue where sometimes the liquid above would produce nothing, and therefore scripts that targeted that class would not load in.
After talking with Shopify support and a 3rd party developer, they finally found that renaming the template variable in the shortcode.liquid file removed the issue and still allowed the shortcodes to function.

TL;DR: Please rename your template variable to something less generic in shortcode.liquid

Thanks!

@orsicreative
Copy link

This fixed our exact issue, thank you. We realized our body class was getting set to "template-" but we couldn't figure out what was nulling it

@rickydazla rickydazla linked a pull request Jan 22, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants