Tense Index: Templates: if

Inserts its contents if its value satisfies the equation.

Attributes

value: the value to compare. If no other attributes are given and it is equal to true, the contents are returned.
equalto: if the value is equal to this, the contents are returned.
notequalto: if the value is not equal to this, the contents are returned.
lessthan: if the value is less than this, the contents are returned.
greaterthan: if the value is greater than this, the contents are returned.

Example

<tenseindex:files>
<tenseindex:if value="{tenseindex:filenew value='true' oldvalue=''}">
<tenseindex:filelink /><br />
</tenseindex:if>
</tenseindex:files>

This example would display only the files that are new.

Changes

The equalto, lessthan, and greaterthan attributes were added in Tense Index 3.0 beta 2. The notqeualto attribute was added in Tense Index 3.1. Also as of Tense Index 3.1, you can do multiple comparisons in a single if tag. If any one of them is true, the contents will be returned. Note that each attribute can only be used once, however.

Last updated March 21st, 2007

You are here: Tense Code: Tense Index: Templates: if
Can't find what you're looking for? View a complete site map.