if-PREFIX-data
Summary
- [if-PREFIX-data table column] column value is true [else] column value is false [/else] [/if-PREFIX-data]
Description
This loop sub-tag tests the named column in the named table.
If the column's value evaluates true (non-blank and non-zero)
then the IF text will be returned.
If it evaluates false then the text in the optional
[else] block will be returned.
This is much more efficient than the otherwise equivalent:
|
[if type="data" term="table::column::[PREFIX-code]"]
|
You can reverse the IF text and ELSE text by using the "!" (not) operator,
as follows:
[if-PREFIX-data !table column]
IF (not found) text
[else]
ELSE (found) text
[/else]
[/if-PREFIX-data]
|
You can test the column for a specific value,
using any of the Interchange test operators,
as follows:
[if-PREFIX-data table column =~ /kevin|walsh/]
Yay!
[else]
Bah!
[/else]
[/if-PREFIX-data]
|
See also