Layout Element (Data)

From HLKitWiki
Revision as of 03:35, 3 December 2008 by Rob (Talk | contribs) (New page: {{context|Kit Reference|Data File Reference}} ==The "layout" Element== Layouts contain an assortment of portals and templates that serve a unified purpose when presenting information...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Context: HL KitKit Reference … Data File Reference 

The "layout" Element

Layouts contain an assortment of portals and templates that serve a unified purpose when presenting information to the user. Each layout is specified through the use of a "layout" element. The complete list of attributes for this element is below.

id Id – Specifies the unique id of the layout. This id is used in all references to the layout.
marginhorz (Optional) Integer – Specifies the margin gap included at both ends along the horizontal axis. The usable width of the layout is the actual width minus double the horizontal margin. Default: "0".
marginvert (Optional) Integer – Specifies the margin gap included at both ends along the vertical axis. The usable height of the layout is the actual height minus double the vertical margin. Default: "0".

The "layout" element also possesses child elements that define various facets of the layout. 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.

live An optional "live" element may appear as defined by the given link. This element defines a Live Tag Expression that determines whether the template is shown to the user.
portalref Zero or more "portalref" elements may appear as defined by the given link. This element specifies the individual portals which are utilized within the layout.
templateref Zero or more "templateref" elements may appear as defined by the given link. This element specifies the individual templates which are utilized within the layout.
position An optional "position" element may appear as defined by the given link. This element defines a Position Script through which the portals are sized and positioned within the template.

The "live" Element

The "live" element defines a Live Tag Expression for the layout, which determines whether the layout is shown. The tag expression is compared against the tags assigned to the container associated with the layout (e.g. the actor). If the tag expression is satisfied, the layout is visible, else it is hidden. The complete list of attributes for this element is below.

PCDATA Script – Specifies the code comprising the Live tag expression.

The "position" Element

The "position" element defines a Position Script for the layout, which performs all the appropriate sizing and positioning of the contained portals and templates within the region of the layout. The complete list of attributes for this element is below.

PCDATA Script – Specifies the code comprising the Position script.

Example

The following example demonstrates what a "layout" element might look like. All default values are assumed for optional attributes.

<layout id="journal">
  <portalref portal="jrTitle"/>
  <portalref portal="journal" taborder="10"/>
  <templateref template="jrHeader" thing="actor"/>
  <position>
    ~configure whether our header is visible or not
    ~Note: If the header is non-visible, no space is allotted for it below.
    template[jrHeader].visible = 1

    ~position the title at the top, followed by the template, and then the table
    perform portal[jrTitle].autoplace
    perform template[jrHeader].autoplace[6]
    perform portal[journal].autoplace[9]
    </position>
  </layout>