<cti:define> Instruction

Top  Previous  Next

<cti:define> compile time instruction lets you to define custom compile time functions. In that sense the aim of it is the same as the aim of %define() function. The difference is <cti:define> provides more comfortable way of defining functions that returns HTML or XSL codes.

Syntax:

 <cti:define name="function-name">

  <!--

     function definition

    -->

 </cti:define>

 

You can use ${prmn} parameter symbols inside the function definition as needed.

Example 1:

Definition:

 <cti:define name="eb">

  <input type="text" name="${prm1}"/>

 </cti:define>
Usage:

    %eb(quantity)
 

Result:

   <input type="text" name="quantity"/>

 

Example 2:

In the below example function %cb() is defined in a dummy elementusing <cti:define> instruction and used in a cell of a richtext table to create a checkbox.

 

define

 

When the page is generated the result will be similar to the following.

result