Jamie Jackson wrote:
> Please tell me if the following is possible, and how: I want to stifle
> the output of the area between <cf_MyTag> and </cf_MyTag>.
>
> Here is a simplified example: I the following output: "Hello World, I
> do want to display this sentence."
>
> ### Calling script ###:
> <cf_MyTag>
> Hello, World, I do NOT want to display this sentence.
> </cf_MyTag>
>
> ### MyTag.cfm (custom tag) ###:
> <cfoutput>#ReplaceNoCase(ThisTag.GeneratedContent, 'do NOT',
> 'do')#</cfoutput>
>
> Currently, this displays:
> "Hello, World, I do NOT want to display this sentence. Hello, World, I
> do want to display this message." (Obviously, I don't want the first
> sentence displayed.)
>
> Is this best handled by <cfsetting cfoutputonly="yes">, or is there
> another way that's already built into the custom tag framework?
2 things:
- make sure you use thistag.executionmode
- reset thistag.generatedcontent to ""
Code should look like:
### Calling script ###:
<cf_MyTag>
Hello, World, I do NOT want to display this sentence.
</cf_MyTag>
### MyTag.cfm (custom tag) ###:
<cfif ThisTag.ExecutionMode IS "End">
<cfoutput>
#ReplaceNoCase(ThisTag.GeneratedContent, 'do NOT','do')#
</cfoutput>
<cfset ThisTag.GeneratedContent = "">
</cfif>
Jochem
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists