For more information... RTFM!
NAVIGATION
PAGES THAT LINK HERE
ACCOUNT LOGIN

You are not logged in

Powered by Interchange version 5.7.0

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

Category:  Looping tags and sub-tags
Last modified by: Kevin Walsh
Modification date: Wednesday 19 September 2007 at 5:46 PM (EDT)
Home  |  Legal nonsense  |  Privacy policy  |  Donations  |  Contact us