Label Element (Data)

From HLKitWiki
Revision as of 13:10, 1 December 2008 by Rob (talk | contribs) (New page: {{context|Kit Reference|Data File Reference|Portal Element (Data)}} ==The "label" Element== When you want to display text to the user, it's usually easiest to utilize a label portal, whi...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Context: HL Kit … Kit Reference … Data File Reference … Portal Element (Data) 

The "label" Element

When you want to display text to the user, it's usually easiest to utilize a label portal, which is specified through the use of a "label" element. The complete list of attributes for this element is below.

IMPORTANT! Only one mechanism for specifying the label contents may be employed within a given label portal. That means you may use either the "text" attribute, the "field" attribute, OR the "labeltext" script to define the contents. Use of multiple mechanisms will result in a compilation error.

text (Optional) Text – Specifies a string of literal text to be displayed within the label. Default: Empty.
field (Optional) Id – Specifies the unique id of the field whose value is to be displayed within the label. The field must exist within the pick/thing associated with the containing template. If this portal is not defined within a template, a field-based label is not allowed. Default: Empty.
ismultiline (Optional) Boolean – Indicates whether the label text is to be treated as multi-line or merely a single line of output. Default: "no".
scrollable (Optional) Boolean – Indicates whether the label text is large enough to require a vertical scroller be included that allows the user to scroll through the contents. Default: "no".
istitle (Optional) Boolean – Indicates whether the label text is being used as a title, which entails special automatic sizing behaviors for proper handling. Default: "no".

The "label" element also possesses child elements that define additional behaviors of the portal. The list of these child elements is below and must appear in the order shown. Click on the link to access the details for each element.

labeltext An optional "labeltext" element may appear as defined by the given link. This element defines a Label Script that is used for synthesizing the text to be output.

The "labeltext" Element

The "labeltext" element defines a Label Script for the portal. The complete list of attributes for this element is below.

PCDATA Script – Specifies the code comprising the Label script.

Example

The following example demonstrates what a label portal might look like. All default values are assumed for optional attributes.

<portal id="name" style="lblNormal" showinvalid="yes">
  <label field="name"/>
  </portal>

<portal id="cost" style="lblNormal">
  <label>
    <labeltext>
      @text = field[grCost].text
      </labeltext>
    </label>
  </portal>