Join the Webstudio community

Updated 4 weeks ago

Any workarounds for global variables?

I have a Radix switch on my page.
When I toggle the switch, I want to display data in my collection accordingly (with a conditional expression).
My issue is that the switch data variable is only available to the children of the switch instance, but I would like to access the current value of this variable on all components on the page.
Is there a workaround I can use to achieve this?
B
A
2 comments
Current approach is to submit a form with get method to current page so system.search get updated and can be used anywhere on the page.
Thanks a ton @TrySound!
I was previously trying to replace query parameters using js in the expression editor, but that wasn't working.
A form submit works!
Add a reply
Sign up and join the conversation on Discord