umm.... yep I think it is CF 5 come to think of it (sorry). As an
alternative, you could do the following (using Application variables in this
case)
<Cflock>
<cfif NOT Isdefined('application.myselectbox')>
<cffile action="read" file="fileContainingJustTheSelectBoxHtml"
variable="Application.myselectbox">
</cfif>
</cflock>
Where you want to use it:
<cflock>
<cfoutput>#application.myselectbox#</cfoutput>
</cflock>
Or you might just use <cfscript> and build a long string variable using
string concatenation. <cfscript> makes it easy because you can do line
breaks and the formatting will look right to you.
..Just some ideas.
-mk
-----Original Message-----
From: Ciliotta, Mario [mailto:mario.ciliotta@;csfb.com]
Sent: Friday, November 01, 2002 12:46 PM
To: CF-Talk
Subject: RE: Performance Tweaking - Friday Morning Brain Fart
Hi all,
Hate to ask this question, but is savecontent a 5.0 and above tag. I am
still in the 4.5 world, starting to migrate to MX.
Mario
-----Original Message-----
From: Mark A. Kruger - CFG [mailto:mkruger@;cfwebtools.com]
Sent: Friday, November 01, 2002 12:06 PM
To: CF-Talk
Subject: RE: Performance Tweaking - Friday Morning Brain Fart
if it's exactly the same output (html output), then you could use
<cfsavecontent>. Sytax is:
<cfsavecontent variable="MySelectbox">
<select name="blah">
<option value="1"> blah 1</option>
<option value="2"> blah 2</option>
<option value="2"> blah 1</option>
</select>
</cfsavecontent>
Watch out for <cfsetting enablecfoutputonly="yes"> . If you have set this,
the cfcontent will only trap whatever is between output tags. It basically
traps the output buffer from the point of the call. To use the variable,
simply output it to the page:
<form method="post" action="thispage.cfm">
<Cfoutput>#mySelectbox#</cfoutput>
</form>
It's always a string.
One way I've used this in the past is in dynamically generating an HTML
email that includes some stock quotes or charts etc. Build it once, then
use it ina query driven email over and over again. It works well.
-mk
-----Original Message-----
From: Ian Lurie [mailto:ian@;portentinteractive.com]
Sent: Friday, November 01, 2002 10:29 AM
To: CF-Talk
Subject: Performance Tweaking - Friday Morning Brain Fart
Hi all,
I've done this before but am having a post-halloween party moment:
1. I have a chunk of code that generates a drop-down menu. The menu's used
again and again on a page.
2. I want to generate that code once, insert it into a variable, and then
reuse it. That'll shave a LOT of time off the page execution time.
I dimly remember an article by Ben Forta (I think) about this - can someone
refresh my sugar-addled brain?
Thanks,
Ian
--
Portent Interactive
Effective web sites through Conversation Marketing �
http://www.portentinteractive.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm