Documentation Menu

1.5 Template Project

The Joomla! Documentation Working Group is running a project to develop detailed reference and tutorial material on Joomla! 1.5 templates.  There is a project page on the documentation wiki where you can see the work in progress and help us by contributing your knowledge.

Who's Online

We have 7 guests online

Help Site License

The Joomla! Help Site content is copyright © 2005 - 2008 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution NonCommercial ShareAlike 2.5. Some parts of this website may be subject to other licenses.
Home arrow patTemplate arrow patTemplate Tags arrow Sub Tag

Sub Tag PDF Print E-mail
<patTemplate:sub>

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

Attributes

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


Example:

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