OpenWGA 7.6 - OpenWGA Concepts and Features

Design and development » WebTML » Basic concepts » Options

Usage and scope

 WebTML options are mostly defined via WebTML tag <tml:option> which is in the body of either a <tml:include|portlet> or an <tml:element>. These tags are called option receivers.

<tml:include ref="mod:rtf-field">

  <tml:option name="field">body</tml:option>

</tml:include>


<tml:portlet ref="system:window">

  <tml:option name="border-style" expression="profile.borderstyle"/>

</tml:portlet>


<tml:element name="childnav">

  <tml:option name="filter">WGA.modifyDate(PAGEPUBLISHED, "m", 1) > WGA.createDate()</tml:option>

</tml:element>

It does not matter how deep inside <tml:include|portlet|element> the <tml:option> is cascaded in other WebTML tags, they will always receive the option. So this is also possible:

<tml:element name="childnav">

  <tml:case condition="profile.hideold == true">

    <tml:option name="filter">WGA.modifyDate(PAGEPUBLISHED, "m", 1) > WGA.createDate()</tml:option>

  </tml:case>

</tml:element>

The option receivers pass on the option to the functionality they include, so an included WebTML module/portlet or an WebTML element.

Inside a WebTML module <tml:option> or this.option() can be used to read the option values where they are needed.

The attribute scope on <tml:option> can be used to reduce the scope of WebTML options when they are used inside <tml:include|portlet>. Normally the scope of an option is not limited on the way down the tag and module hierarchy. An included WebTML module may include other modules which each still include even more modules. A WebTML option would be passed down eternally to these includes. This behaviour equals the default "scope" setting of "global".

Alternatively the scope attribute can be set to "local". This means that the option will only be available to the directly included web module. This keeps the option from influencing modules deeper down the inclusion hierarchy and is also relevant for performance when using AJAX portlets, as the following chapter shows.