Gossamer Forum
Quote Reply
Nested Ifs
<%ifnot...%> works just like <%if..%> except
<%if variable%> tests to see if there is the 'variable'.
<%ifnot variable%> test to see if the variable
doesn't exist. <%ifnot ...%> must end with a <%endif%>
like <%if...%> does.

Are there some more possibilities like
<if a eq 'x'> and <ifnot a eq 'x'>
whats with <= or 'and' + 'or'

Could i do:
<if a eq 'x'>
<if b eq 'x'>
then do
<endif>
<endif>

Robert



Quote Reply
Re: Nested Ifs In reply to
I found putting the nested if statements in the template perl script file and define the output as a variable, then defining the tag with the variable works pretty well.

Example:

Code:

if (($rec{'FieldA' eq 'value') && ($rec{'FieldB'} eq 'value')) {
$variable .= qq|HTML|;
}
else {
$variable .= qq|HTML|;
}


Then define the tag:

Code:

variable => $variable


Then in your template file, put the following tag:

Code:

<%variable%>


Regards,

Eliot Lee