Join the Webstudio community

Updated 3 months ago

Global variables

At a glance

The community members are discussing how to make data variables available globally across all pages, rather than just locally within a slot. The current workaround of copying variables to each page is described as a "terrible workaround". One community member is working on implementing global variables, and others are looking forward to this update as it would be helpful for building multi-lingual sites. An issue has been raised on GitHub to track this feature request.

Useful resources
Good afternoon, where to add Data Variables to make them available on all pages?
I tried to add them to “slots”, but then they are only available locally in the slot.
D
B
O
17 comments
I'll tell you right away what I need them for: for authorization by API (GraphQl), for database query variables, etc....
I'm working on global variables right now 😉
current workaround is to copy those variables in the pages or slots where they are needed, but this is a terrible workaround
By the way, copying also does not work, or rather it is impossible to insert data in the format in which the variable is copied.
you mean when you copy an instance with data variables, data variables don't get copied over?
In any case, copying is not the way to go since there could be hundreds of pages 🙂
I meant copy instance, not page
You can copy it, but you can't paste it somewhere. ))
You can paste it into "URL" field
The format is called cURL
Yeah, got it, thanks. Except it's not a solution if there are more than 2 pages.😅
Will be fixed soon
If possible, make global variables global at all, so that they are available for both pages and slots. Thanks!
This is the idea
I am very much looking forward to this update. As it turned out, when layout a multi-lingual site - just a necessary chip.
Add a reply
Sign up and join the conversation on Discord