> I have a problem with including a CFOUTPUT tag in a CFIF.
>
> <cfif groupsection IS "off">
> <cfoutput>
> </cfif>
>
> Regardless of what "groupsection" is set to, the <cfoutput>
> tag is processed in the page and of then getting errors when
> compiling. Is there a trick to getting CF to not see the
> <cfoutput> when groupsection is set to anything other than
> off?
The problem here is that the page is completely parsed before it's executed.
When it's parsed, CF doesn't know whether the CFIF will execute or not -
that's a runtime decision. So, CF can't guarantee that there will be both an
opening and a closing CFOUTPUT tag. This is why you can't nest an opening or
a closing tag by itself within a CFIF block - you need to nest both the
opening and the closing tags.
This won't work:
<cfif sometest>
<cfoutput>
</cfif>
....
<cfif sometest>
</cfoutput>
</cfif>
This will work:
<cfif sometest>
<cfoutput>
...
</cfoutput>
</cfif>
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists