The community member has a question about the scope of variables in their application. They explain that when they create a Slot element and a variable within it, the variable is not visible to the content inside the slot. Similarly, when they create variables in a wrapper element inside the body, those variables are not accessible in the page settings like Title and Description.
In the comments, another community member explains the current limitations of the platform. They state that the Slot element has an isolated scope, so only variables defined within the slot are accessible to its content. They also mention that the body is the only scope accessible to the page settings, and variables defined deeper in the component tree are not visible there.
The community member also asks about the Global Root concept, where they would like to store global variables like CMS tokens, but they are unable to access any variable data in this scope. The commenter explains that the Global Root currently only supports the style panel with CSS variables, but in the future, it will also manage global data variables that will be accessible in the page settings.
There is no explicitly marked answer in the provided information
Hi! I have a question about the scope of variables. For example, I create a Slot element, and create a variable in it... and in this slot I have a certain page element, to which I would like to dynamically pass this variable, so that having the same design of the slot content on different pages to enter dynamic data from this variable... But only the variable created on the Slot element - inside the slot is not visible....
The same problem with the structure given in your videos, there is a body, the wrapper element inside the body, on which I create variables requesting resources from my headless cms, and inside the wrapper everything is ok I can use these resources in different elements of the site. But as soon as I need to use this data to fill Title and Description - in page settings - there is a problem, the resources of wrapper are not visible there, and I need to recreate all resources to body if I want them to be available in Title and Description.
And in the same Global Root there are no variable data at all, although the tokens for my cms and some other data would be convenient to keep in the global scope of the site, rather than create a new one on each page.
Slot is limited at the moment with isolated scope. Only variables from inside of slot are available to slot content. This will be improved with custom components later.
Body is the only scope accessible to page settings. Variables defined deeper in the tree are just unaccessible.
Global Root is the new concept, for now supports only style panel with css variables. In the future it will also manage global data variables. And they will be accessible in page settings as well because global scope is higher.