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-pos

Summary

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

Description

This loop sub-tag looks up the value of the array element associated with the looping tag's current row.  Each loop iteration returns an array of columns, set in searches with mv_return_fields.

If the value of the Nth column (numbered from zero) 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-pos !N]
    IF (not found) text
[else]
    ELSE (found) text
[/else]
[/if-PREFIX-pos]

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

[if-PREFIX-pos N =~ /kevin|walsh/]
    Yay!
[else]
    Bah!
[/else]
[/if-PREFIX-pos]

See also

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