Plasma GitLab Archive
Projects Blog Knowledge


[UP]
The UI language
 ui:a
 ui:alist-value and ui:alist-item
 ui:application
 ui:button
 ui:checkbox
 ui:cond
 ui:context
 ui:default
 ui:dialog
 ui:dyn-enum-value and ui:dyn-enum-item
 ui:dynamic
 ui:encode
 ui:enum-value and ui:enum-item
 ui:enumerate
 ui:enumeration and ui:enum
 ui:false
 ui:file
 ui:form
 ui:if
 ui:ifexpr
 ui:iflang
 ui:ifvar
 ui:imagebutton
 ui:iter-*
 ui:iterate
 ui:page
 ui:param
 ui:popup
 ui:radio
 ui:richbutton
 ui:select
 ui:server-popup
 ui:special
 ui:string-value
 ui:template
 ui:text and ui:password
 ui:textarea
 ui:translate
 ui:true
 ui:use
 ui:variable
 t:*, q:*, and p:*
 l:*
 $param
 $[expr]
 Dot notation (v1.v2)
   
The element ui:use

This element instantiates a template. For an overview, see the chapter about Templates.

Declaration

Level: Control structure

<!ELEMENT ui:use ( ui:param )* >

<!ATTLIST ui:use
          template NMTOKEN #REQUIRED>
Attributes

  • template: Names the template to instantiate. Note that the current language of the dialog may also influence which template is selected (see below).

Sub elements

The ui:param elements define the actual values for the lexical parameters

Internationalization

If a certain language is selected for the dialog, this also affects the template system. In particular, it is first checked if the used template is defined for this language, and if so, this version of the template will be used. Otherwise, it is checked whether there is a template without xml:lang attribute, and if it can be found, this version will be used.

For more information, see the chapter about Internationalization.

The t namespace

Because ui:use is a quite long notation, there are two ways to abbreviate it. Instead of

<ui:use template="x">
  <ui:param name="p1">t1</ui:param>
  ...
  <ui:param name="pN">tN</ui:param>
</ui:use>
you can also write

<t:x>
  <p:p1>t1</p:p1>
  ...
  <p:pN>tN</p:pN>
</t:x>
Furthermore, the parameters can also be passed by attributes if they only consist of unstructured text:

<t:x p1="t1" ... pK="tK">
  <p:pJ>tJ</p:pJ>
  ...
  <p:pN>tN</p:pN>
</t:x>
The q namespace

The other way to abbreviate ui:use is the q namespace. Instead of writing

<ui:use template="x">
  <ui:param name="p1">t1</ui:param>
  ...
  <ui:param name="pN">tN</ui:param>
  <ui:param name="body">tBODY</ui:param>
</ui:use>
(note the fixed name body) it is also possible to call the template by:

<q:x p1="t1" ... pK="tK">
  tBODY
</q:x>
Example

See Templates.

This web site is published by Informatikbüro Gerd Stolpmann
Powered by Caml