Sub Tag

This tag may only appear inside a template of type OddEven or Condition. It marks the beginning of a subtemplate.


condition (required)

If the tag is used within an OddEven template, the condition attribute may only be set to Odd or Even.

If it is used within a template of type Condition, you may define any condition you like. The value of the conditionvar you defined in the <patTemplate:tmpl> tag will be compared to the condition you set and if they are the same this subtemplate will be used for output.

There are several predefined conditions:

  • __default   is used when no other condition equals the value and empty
  • __empty  no value for the condition was set
  • __first  the first entry when more than one variable is set
  • __last  the last entry when more than one variable is set


<patTemplate:tmpl name="cond" type="condition" conditionvar="foo">
    <patTemplate:sub condition="0">
        Zero has been supplied!<br />
    <patTemplate:sub condition="bar">
        Bar has been supplied!<br />
    <patTemplate:sub condition="argh">
        The argh was here!<br />
    <patTemplate:sub condition="__default">
        unknown<br />
    <patTemplate:sub condition="__empty">
        empty<br />
    <patTemplate:sub condition="__first">
        First entry<br />
    <patTemplate:sub condition="__last">
        Last entry<br />
Last Updated ( Tuesday, 01 November 2005 )