If the tag is just returning a variable into the calling template you could
do something like this:

<cf_zerooutput>
<cf_mycustomtag>
</cf_zerooutput>

And in zerooutput.cfm:

<cfif thistag.executionmode eq "end">
<cfset thistag.generatedcontent = "">
</cfif>

This will clean up a lot of white space.  Useful if you have a lot of
looping, etc.

DC


----- Original Message -----
From: "Jamie Jackson" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Friday, May 18, 2001 16:19
Subject: Re: EnableCFoutputOnly not cutting the mustard in Custom Tag


> On Fri, 18 May 2001 12:34:30 -0600, "Jim McAtee"
> <[EMAIL PROTECTED]> wrote:
>
> <snip>
> >> See the value in this?
> >
> >
> >No.  If you don't want white space around the returned string then
there's
> >no reason it should be returned by the custom tag!
> Uhh.... that was my point, I think you missed something.  I was trying
> to get rid of the space that the custom tag was generating.  I'm glad
> we're in agreement that the space is not desireable ;-)
>
> >Trim it within the tag.
> Again... you're preaching to the choir.
>
> >Also, for maximum flexibility (and safety) you should pass in the name of
> >the caller variable, rather than using a predetermined name.
> That's a good idea. Not really appropriate for this particular custom
> tag, but I see applications where that would be prudent.
>
> Thanks,
> Jamie
> ><cf_MyCustomTag inputstuff="48" variable="myVariable">
> ><cfoutput>#myVariable#</cfoutput>
> >
> >Your custom tag then does something like:
> >
> ><cfparam name="variable">
> ><!---
> >      processing to arrive at a value within the internal variable
> >     called 'returnvalue' ...
> >--->
> ><cfset temp = SetVariable("caller.#attributes.variable#",
> >Trim(returnvalue))>
> >
> >
> >Jim
> >
> >
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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

Reply via email to