Nice one. I'll examine this a little later. Thank you for your input Paul.
andy -----Original Message----- From: Paul Vernon [mailto:paul.ver...@web-architect.co.uk] Sent: Wednesday, January 14, 2009 10:41 AM To: cf-talk Subject: RE: CFC or UDF to rewrite the <title> tag of a document? Actually you can "go back" and modify the content of the buffer... 1. In onRequestStart, set up a cfparam <cfparam name="Request.HTMLPageTitle" value=""> 2. Use this in the onRequestEnd function. Obviously you'll need to var the code where appropriate... <cfif Request.HTMLPageTitle NEQ ""> <cfset currentBuffer = REReplaceNoCase(getPageContext().getOut().getBuffer().toString(), "<title>[^\<]*</title>", "")> <cfhtmlhead text="<title>#request.HTMLPageTitle#</title>"> <cfcontent reset="true"><cfoutput>currentbuffer</cfoutput> </cfif> 3. Create your changeTitle function and add the following code into it... <cfset Request.HTMLPageTitle = arguments.HTMLPageTitle> That should do it... Yours Paul Vernon http://www.newmediadevelopment.net t: 0871 425 4260 m: +44 (0)7887 952591 f: 0871 425 4261 e: mailto:paul.ver...@newmediadevelopment.net The information contained in this e-mail and any attachment is intended only for the named addressee(s). If you are not the named addressee(s), please notify the sender immediately and do not disclose, copy or distribute the contents to any other person other than the intended addressee(s). > Andy Matthews wrote: > > To clarify, what I'm looking for is the ability to override the > > title > tag > > before the rendered HTML is sent to the browser. > > > > > That is not going to happen with a simple function, neither UDF or > Component, in a normal flow of processing. CFML process sequentially > from start to finish and can not go back and change output already put > into the buffer for delivery to the web server and ultimately the > client's browser. > > To do something like this you will either have to manually capture the > output and then modify it as desired or intercept the output before > delivery to the web server. The latter can be done with the OnRequest > method of an Applicaiton.CFC or manipulating the underlining Java > 'page' > object. > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317948 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

