Scopes decribe where a key can be used to find content or not. If you are trying to print content using a key but no content is printed, there is a big chance you are trying to print it out of scope.
The scope you are currently in is always defined by all children beneath the key you are currently writing within.
The key you are currently writing within is defined either by the view you are writing in, or the tag you are writing in.
As an example, given you are writing in the view
Home.cshtml which corresponds to the view Home in the Easyweb Studio, you can reach all keys added to that view.
Lets say you add a section with key "hero-items" that contain an image "hero-image" and a textfield "hero-text" and allow multiple input. Next to it you also add a HTML-field with key "about_us". Your structure in the home view would look something like:
|- hero-items (section/list of items)
|- hero-text (textfield)
|- hero-image (image)
|- about-us (html-text)
In the case above, one scope would be defined by the Home root, allowing you to print all keys beneath it. Another scope would be defined by the "hero-items" key, in which you would only have the keys "hero-text" and "hero-image" beneath it available.
Given a view
Home.cshtml containing the following, the HTML-comments would describe how the scopes are wrapped:
<!-- By default we exist in the scope of Home -->
<!-- Because of the ew-list above, we are now scoped to the hero-items component, and can only reach items within that node -->
<img ew-for-src="hero-image" />
<!-- Trying to print the about-us key in here like below would not find anything: -->
<!-- The scope ends with the tag closing our ew-list -->
<!-- We are now back in the home-scope and can reach any key under the Home-view again -->
<!-- Printing the about-us key here would find the proper content: -->
Printing content out of scope
There are situations where you need to print content that exists outside of the scope you want to print it within. To achieve that, there are certain keys that allow you to navigate different scope using special keys starting with
$parent key allows you to climb up one level and search for a key from there. You can combine multiple
$parent-keys as well.
<ew-template for-key="$parent/some-key" />
$layout and $settings
It is sometimes beneficial to add shared content as field in the Layout- or Settingsview. The settings-content is only available prefixed with the $settings-key, and layout content is, outside of a Layout-view-scope (such as _Layout.cshtml), available using the $layout-key.
<ew-template for-key="$layout/some-key" />
Some other available keys include