All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Can I use a Low Variable from another MSM site in a JS file?

Vaughn D. Taylor 9 Oct 2012 19:12 problem, active

Hi,

I store my JS files as templates in EE. It works great because then I can pass Low Variables into my JS. This works properly:

var phoneNaturalSearch = '{lv_phone_natural_search}';

Now I need to share this script with another site (I'm using MSM). I'd like to keep the Low Variables in place so that I don't need to hard-code them. So, I tried this:

var phoneNaturalSearch = '{exp:low_variables:parse var="default_site:lv_phone_natural_search"}';

Which does not work. Do you have any recommendations on what I may be doing wrong? Should this work?

Replies

  1. Low 10 Oct 2012 07:57

    Yeah, it should work. Make sure the site short name (default_site) is correct. Also try and use {exp:low_variables:single}, especially if you have other Parse tags in the template.