If the field in the database as just the CF variable, you can do this:
<cfquery datasource="#DSN_source#" name="QT">
select title from pages where pageID=11
</cfquery>//This is the value returned by the query: #news#
<cfset news="Hi Mom">
<cfoutput>
        #evaluate(QT.title)#
</cfoutput> 
        //Returns:  Hi Mom

If you have text, HTML, and CF mixed, and you know the CF variables in
there, you can do a replace.  For instance if you know lname and fname are
in the text:

<cfquery datasource="#DSN_source#" name="QT">
        select title from pages where pageID=11
</cfquery>//This is the value returned by the query: #fname# is my
firstname.  #lname#.
<cfset fname="Bob">
<cfset lname="Smith">
<cfoutput>
        <cfset outputVar=replaceNOCASE(QT.title,"#fname#", fname,"ALL")>
        <cfset outputVar=replaceNOCASE(outputVar,"#lname#", lname,"ALL")>
        #outputVar#
</cfoutput> 

Or you can save out to a file, depending on what you are trying to do and to
what scale.:)

Jacob

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Clint Tredway
Sent: Tuesday, October 21, 2003 12:15 PM
To: [EMAIL PROTECTED]
Subject: RE: cfoutput issue...

CF can't run that code because it sees it as text and not cfcode. You will
need to save this as an actual file and then include that file for it to
work.

Clint Tredway
www.digital12studios.com


Original Message:

Return-Path: <[EMAIL PROTECTED]> Tue Oct 21 10:10:07 2003
>Received: from smtp.imailbox.com [207.168.61.195] by mail16.crystaltech.com
with SMTP;
>   Tue, 21 Oct 2003 10:10:07 -0700
>Received: from mx10.imailbox.com (unverified [207.168.61.213]) by 
>imailbox.com  (Rockliffe SMTPRA 5.2.5) with ESMTP id 
><[EMAIL PROTECTED]> for <[EMAIL PROTECTED]>;  Tue, 21 Oct 
>2003 12:15:51 -0500
>Received: from c001.snv.cp.net (h007.c001.snv.cp.net [209.228.32.121])
>       by mx10.imailbox.com (Postfix) with SMTP id A1E494A3
>       for <[EMAIL PROTECTED]>; Tue, 21 Oct 2003 12:13:41 -0500 (CDT)
>Received: (cpmta 13356 invoked from network); 21 Oct 2003 10:03:21 
>-0700
>Received: from 64.207.59.196 (HELO UGAnbailey)
>  by smtp.register-admin.com (209.228.32.121) with SMTP; 21 Oct 2003 
>10:03:21 -0700
>X-Sent: 21 Oct 2003 17:03:21 GMT
>From: "Neal Bailey" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Subject: RE: cfoutput issue...
>Date: Tue, 21 Oct 2003 12:05:11 -0500
>Organization: Advanced GraF/X
>Message-ID: 
><[EMAIL PROTECTED]>
>MIME-Version: 1.0
>Content-Type: text/plain;
>       charset="us-ascii"
>Content-Transfer-Encoding: 7bit
>X-Priority: 3 (Normal)
>X-MSMail-Priority: Normal
>X-Mailer: Microsoft Outlook, Build 10.0.2627
>Importance: Normal
>In-Reply-To: 
><[EMAIL PROTECTED]>
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
>Reply-To: [EMAIL PROTECTED]
>Sender: [EMAIL PROTECTED]
>
>
>
>
>So basically if I have ColdFusion code like <cfoutput>#Link#</cfoutput> 
>stored in a field. ColdFusion will not process this code when I call 
>the field onto my page? Is this right... I could have sworn that this 
>worked in ColdFusion 5.
>
>I would think it would just process the code as normal when I call the 
>field.
>
>Maybe I need more coffee or something it's just not clicking with me...
>
>- Neal
>
>
>-----Original Message-----
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On 
>Behalf Of S.Isaac Dealey
>Sent: Tuesday, October 21, 2003 10:33 AM
>To: [EMAIL PROTECTED]
>Subject: Re: cfoutput issue...
>
>> Hello Everyone,
>
>> I'm having a strange problem, I have a few documents that are stored 
>> in a SQL table and these docs have a little CF code in them that's 
>> used to build some dynamic links to other docs. For some reason when 
>> I <cfoutput> the content of the doc it is not processing the CF code 
>> that's in them. I thought I use to be able to do this. Is there 
>> something that I am missing?
>
>> All I'm doing is a simple:
>
>> <cfoutput>
>> #mydoc#
>> </cfoutput>
>
>> Thanks for any help on this.
>
>
>Hey Neal,
>
>You need to store your content in a file and then include that file, or 
>use a UDF or a custom tag to evaluate variables in order to get what I 
>think you're trying to get...
>
>If you've got a good unique id on the table, something like this might
>work:
>
><cfoutput>
><cfsavecontent variable="mydoc2">
>#chr(asc("<"))#cfoutput>
>#mydoc#
>#chr(asc("<"))#/cfoutput>
></cfsavecontent>
><cffile action="write"
>  file="#expandpath('docs/' & mydocid & '.cfm')#"
>  output="#mydoc#">
><cfinclude template="docs/#mydocid#.cfm">
>
>Or look for a function or a custom tag like the old CF_StringEvaluate
>
>Here's a recent one: http://www.cflib.org/udf.cfm?ID=173
>
>Use the function if you just need variables in your string -- use the 
>include method if the variable mydoc contains coldfusion tags.
>
>
>s. isaac dealey                972-490-6624
>
>team macromedia volunteer      http://www.macromedia.com/go/team
>
>chief architect, tapestry cms  http://products.turnkey.to
>
>onTap is open source           http://www.turnkey.to/ontap
>
>
>-----------------------------------------------
>To post, send email to [EMAIL PROTECTED] To unsubscribe:
>   Send UNSUBSCRIBE to [EMAIL PROTECTED] To subscribe / 
>unsubscribe: http://www.dfwcfug.org
>
>
>-----------------------------------------------
>To post, send email to [EMAIL PROTECTED] To unsubscribe:
>   Send UNSUBSCRIBE to [EMAIL PROTECTED] To subscribe / 
>unsubscribe: http://www.dfwcfug.org
>
>
>


-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To unsubscribe: 
   Send UNSUBSCRIBE to [EMAIL PROTECTED] To subscribe / unsubscribe:
http://www.dfwcfug.org



-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To unsubscribe: 
   Send UNSUBSCRIBE to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org

Reply via email to