Automatically Create and Wire a Fragment Variable on Its Container
You can mark fragment variables or constants that are enabled as input parameters to be automatically created on the container that uses the fragment. This way, when a page is created from the fragment or the fragment is dropped onto an existing page or container, VB Studio creates the variable (or constant) on the page and wires it back to the fragment variable's (or constant's) value.
This option is especially useful when input parameters must be passed from a page for the fragment to work. By autowiring the required input parameters, you won't have to create and configure those variables on the page when the fragment is added to it, though you'd still need to assign values. Further, if the autowired variables include customizations to display an enhanced UI in the Properties pane, those customizations are also carried over to the container.
Note:
Only fragments tagged aspageContent
(default) or page
in its Used For setting (either from its Properties pane or Settings editor) can be autowired on their containers.
After you add the fragment to a page or a container, you'll see your variable/constant created on the page or container's Variables editor with the settings you specified.
If you were to look at your page's code, you'll see the parameters wired in HTML, for example:
<oj-vb-fragment bridge="[[vbBridge]]" name="welcome" class="oj-flex-item oj-sm-12 oj-md-12">
<oj-vb-fragment-param name="avatar" value="[[ $variables.avatars ]]"></oj-vb-fragment-param>
<oj-vb-fragment-param name="days" value="[[ $variables.days ]]"></oj-vb-fragment-param>
<oj-vb-fragment-param name="title" value="[[ $variables.title ]]"></oj-vb-fragment-param>
</oj-vb-fragment>