User Guide

Chapter 1: ColdFusion Tags 101
</CFOUTPUT>
<P>If we would like more than one condition to be the case,
we can ask for a list of the centers in San Diego <B>OR</B>
Santa Ana. If the center does not follow this condition, we
can use CFELSE to show only the names and cities of the
other centers.
<P>Notice how a nested CFIF is used to specify
the location of the featured site (Santa Ana or San Diego).
<!--- use CFIF to specify a conditional choice for multiple
options; also note the nested CFIF --->
<hr>
<P>Complete information is shown for centers in San Diego
or Santa Ana. All other centers are listed in italics:
<CFOUTPUT QUERY="getCenters">
<CFIF city is "San Diego" OR city is "Santa Ana">
<H4>Featured Center in <CFIF city is "San Diego">San
Diego<CFELSE>Santa Ana</CFIF></H4>
<B>Name/Address:</B>#Name#, #Address1#, #City#, #State#
<BR><B>Contact:</B> #Contact#<BR>
<CFELSE>
<BR><I>#Name#, #City#</I>
</CFIF>
</CFOUTPUT>
<P>Finally, we can use CFELSEIF to cycle through a number
of conditions and produce varying output. Note that you
can use CFCASE and CFSWITCH for a more elegant representation
of this behavior.
<hr>
<P>
<!--- use CFIF in conjunction with CFELSEIF to specify
more than one branch in a conditional situation --->
<CFOUTPUT QUERY="getCenters">
<CFIF city is "San Diego" OR city is "Santa Ana">
<BR><I>#Name#, #City#</I> (this one is in <CFIF city is "San
Diego">San Diego<CFELSE>Santa Ana</CFIF>)
<CFELSEIF city is "San Francisco">
<BR><I>#Name#, #City#</I> (this one is in San Francisco)
<CFELSEIF city is "Suisun">
<BR><I>#Name#, #City#</I> (this one is in Suisun)
<CFELSE>
<BR><I>#Name#</I> <B>Not in a city we track</B>
</CFIF>
</CFOUTPUT>
</BODY>
</HTML>