Template Context: Difference between revisions
New page: {{context|Kit Reference|Context Transitions}} See Also: Template Target References From within a "template" context, you can utilize the following set of valid context transitions: ... |
No edit summary |
||
Line 1: | Line 1: | ||
{{ | {{contextmulti|Kit Reference}} | ||
Jump to: [[#references|Target References]] | |||
The "template" context identifies a template within the current hierarchy. Templates can either be used within layouts or within tables, so the parent context of the template within the hierarchy can vary. | |||
==Context Transitions{{anchor|transitions}}== | |||
From within a "template" context, you can utilize the following set of valid context transitions: | From within a "template" context, you can utilize the following set of valid context transitions: | ||
Line 7: | Line 11: | ||
:{| class="infotable" | :{| class="infotable" | ||
|class="leftnormal"|parent | |class="leftnormal"|parent | ||
|Transitions to the [[Layout Context | |Transitions to the [[Layout Context|layout context]] or [[Table Context|table context]] corresponding to the visual element that contains the tmeplate.<br> | ||
Example: this.parent<br> | Example: this.parent<br> | ||
{{note}}The "parent" transition can only be utilized a '''single''' time, so it is not possible to go upwards two or more levels within the hierarchy. | {{note}}The "parent" transition can only be utilized a '''single''' time, so it is not possible to go upwards two or more levels within the hierarchy. | ||
|- | |- | ||
|portal[''id''] | |portal[''id''] | ||
|Transitions to the [[Portal Context | |Transitions to the [[Portal Context|portal context]] corresponding to the portal within the current template that possesses the ''id'' specified. If the portal does not exist within the template, the transition fails to resolve.<br> | ||
Example: this.portal[myportal]<br> | Example: this.portal[myportal]<br> | ||
{{note}}Only portals defined directly within the template can be accessed via this transition. | {{note}}Only portals defined directly within the template can be accessed via this transition. | ||
|- | |- | ||
|field[''id''] | |field[''id''] | ||
|Transitions to the [[Value Context | |Transitions to the [[Value Context|value context]] corresponding to the field within the current template that has the ''id'' specified. The fields for a template are dictated by the pick or thing that is associated with the template. If the given field does not exist for the pick/thing, the transition fails to resolve.<br> | ||
Example: this.field[myfield]<br> | Example: this.field[myfield]<br> | ||
{{note}}Within templates, all fields are treated as read-only, which is controlled by transitioning to a distinct "value" context instead of "field" context. | {{note}}Within templates, all fields are treated as read-only, which is controlled by transitioning to a distinct "value" context instead of "field" context. | ||
|- | |- | ||
|container | |container | ||
|Transitions to the [[Container Context | |Transitions to the [[Container Context|container context]] corresponding to the container to which the template applies, whether it be an actor or a gizmo.<br> | ||
Example: this.container<br> | Example: this.container<br> | ||
{{note}}After transitioning, access within the new container context will be read-only and limited in what information can be retrieved.<br> | {{note}}After transitioning, access within the new container context will be read-only and limited in what information can be retrieved.<br> | ||
Line 28: | Line 32: | ||
|- | |- | ||
|hero | |hero | ||
|Transitions to the [[Hero Context | |Transitions to the [[Hero Context|hero context]] corresponding to the hero to which the template applies.<br> | ||
Example: this.hero<br> | Example: this.hero<br> | ||
{{note}}After transitioning, access within the new hero context will be read-only and limited in what information can be retrieved.<br> | {{note}}After transitioning, access within the new hero context will be read-only and limited in what information can be retrieved.<br> |
Revision as of 23:34, 7 December 2008
Context: HL Kit … Kit Reference … Multiple Sources
Jump to: Target References
The "template" context identifies a template within the current hierarchy. Templates can either be used within layouts or within tables, so the parent context of the template within the hierarchy can vary.
Context Transitions
From within a "template" context, you can utilize the following set of valid context transitions:
parent Transitions to the layout context or table context corresponding to the visual element that contains the tmeplate.
Example: this.parent
NOTE! The "parent" transition can only be utilized a single time, so it is not possible to go upwards two or more levels within the hierarchy.portal[id] Transitions to the portal context corresponding to the portal within the current template that possesses the id specified. If the portal does not exist within the template, the transition fails to resolve.
Example: this.portal[myportal]
NOTE! Only portals defined directly within the template can be accessed via this transition.field[id] Transitions to the value context corresponding to the field within the current template that has the id specified. The fields for a template are dictated by the pick or thing that is associated with the template. If the given field does not exist for the pick/thing, the transition fails to resolve.
Example: this.field[myfield]
NOTE! Within templates, all fields are treated as read-only, which is controlled by transitioning to a distinct "value" context instead of "field" context.container Transitions to the container context corresponding to the container to which the template applies, whether it be an actor or a gizmo.
Example: this.container
NOTE! After transitioning, access within the new container context will be read-only and limited in what information can be retrieved.
NOTE! This transition can only be used as the first transition when within a visual script.hero Transitions to the hero context corresponding to the hero to which the template applies.
Example: this.hero
NOTE! After transitioning, access within the new hero context will be read-only and limited in what information can be retrieved.
NOTE! This transition can only be used as the first transition when within a visual script.