Use global variables in liquid?

  • 23 September 2020
  • 3 replies
  • 20 views

Do we have a way to use a global variable in liquid? For instance assign a variable in Head and use it in Solutions Category Home?


We are looking for a way to create a button (on/off) that can be used to enable or disable certain widgets used in other parts of the customization...


ashwin.nethaji 8 days ago

 Hey @nika.gerson.lohman,

We are afraid that you would not be able to set up a global variable in liquid. If you assign a variable in a particular code section, this would only be available in that section.

Hope this answers your queries.

Cheers!

View original

3 replies

Hey @nika.gerson.lohman,

We are afraid that you would not be able to set up a global variable in liquid. If you assign a variable in a particular code section, this would only be available in that section.

Hope this answers your queries.

Cheers!

 Hey @nika.gerson.lohman,

We are afraid that you would not be able to set up a global variable in liquid. If you assign a variable in a particular code section, this would only be available in that section.

Hope this answers your queries.

Cheers!

Thanks @ashwin.nethaji , too bad as that would make it a lot easier. Guess we'd be stuck using (global) css to retain variables somehow. Does anyone actually have an example how to do this?

Is it worth to log an Enhancement Request somewhere?

Regards,

Nika.

Reply