PLUG'N SCRIPT
rapid plugin development
Tutorial
DSP
KUIML
How-to
Scripts
  • Tutorial
  • Element Reference
Language basics
  • SKIN
  • DUMMY
  • INCLUDE
  • INCLUDE_ONCE
  • DEFINE
  • UNDEFINE
  • VARIABLE
  • LOCAL_VARIABLE
  • TEMPLATE
  • TEMPLATE_INNER_CONTENT
  • REPEAT
Data model
  • PARAM
  • ACTION
    • Action types
  • ACTION_TRIGGER
  • TIMER
UI Layout and positioning
  • CELL
  • TABLE
UI Widgets
  • CANVAS
    • Graphics API
  • COLOR_SCALE
  • FILE_SELECT_MENU
  • GRID
  • INVISIBLE_PARAM_MENU_BUTTON
  • MENU_ITEM
  • MENU_SEPARATOR
  • POPUP_MENU
  • svg
  • RULER
  • TEXT
  • TEXT_FIELD
  • TEXT_EDIT_BOX
  • XY_PARAM_PAD
  • XY_ZOOM_SELECT_PAD
  • XYZ_PARAM_SCRATCH_PAD
  • XYZ_PARAM_CLICK_PAD
  • XYZ_IMAGE_PARAM_JOYSTICK
UI 3D Objects
  • COLOR_SURFACE_3D
  • GRID_3D
  • GL_OBJECT_3D
Data model commands
  • REQUIRED_OBJECTS
  • EXPOSED_OBJECTS
  • PERSISTENT_OBJECTS
Common attrubutes
  • For all elements
  • Widgets
  • Param Widgets
  • Param Controls
  • Param Info Viewers
  • Text Widgets
  • Surface Viewers
  • Curve Viewers
  • 3D Objects
  • Parameters mapping
  • LetiMix
KUIMLElement ReferenceTEMPLATE
March 25, 2024

TEMPLATE

With this element, it is possible to define custom structures and reuse them later in the skin code. The result is similar to the DEFINE capability but it's much more powerful since it is able to reinstanciante complex structures instead of just a single element with predefined values.

It can also be extended using the TEMPLATE_INNER_CONTENT element.

Attributes brief detailed show all inherited

Name Description
idid of the templateThis is the name you will use everywhere in the skin and it will be replaced by the content of the template
default values attributesdefault values for the variables contained in the template definitionYou can add as many attributes as you wish
Name Value type Default Description Comment
idelement idemptyid of the templateThis is the name you will use everywhere in the skin and it will be replaced by the content of the template
default values attributesstringemptydefault values for the variables contained in the template definitionYou can add as many attributes as you wish

Syntax

First, declare a template as shown here:

  1. <TEMPLATE id="TPL_MY_TEMPLATE" attr1="x" attr2="y" ... >
  2. <!--template structure with as many elements as you whish, with implicitly declared local variables-->
  3. <ELEMENTA attribute_a="$attr1$">
  4. <ELEMENTB attribute_c="$wxyz$"/>
  5. </ELEMENTA>
  6. </TEMPLATE>

The attributes values declared in the template definition ("attr1" and "attr2" in the example above) are default values used when these attributes are not defined in the template instantiation.

Once this template has been declared, writing the following.

  1. <TPL_MY_TEMPLATE wxyz="hello"/>

is equivalent to writing:

  1. <ELEMENTA attribute_a="x">
  2. <ELEMENTB attribute_c="hello"/>
  3. </ELEMENTA>

 

2020 - 2025 © Site by LetiMix  |  Plug'n Script and KUIML by Blue Cat Audio