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

You are not logged in

Powered by Interchange version 5.7.0

if-PREFIX-field

Summary

  • [if-PREFIX-field column] column value is true [else] column value is false [/else] [/if-PREFIX-field]

Description

This loop sub-tag looks up the value of the named column, for the current row, in one of several places, in this order:

  1. The first DefaultTables table.
  2. Additional DefaultTables table(s) in the order they occur.
  3. The attribute value for the row in a hash list.
  4. Blank.

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.

You can reverse the IF text and ELSE text by using the "!" (not) operator, as follows:

[if-PREFIX-field !column]
    IF (not found) text
[else]
    ELSE (found) text
[/else]
[/if-PREFIX-field]

You can test the column for a specific value, using any of the Interchange test operators, as follows:

[if-PREFIX-field column =~ /kevin|walsh/]
    Yay!
[else]
    Bah!
[/else]
[/if-PREFIX-field]

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  |  Contact us