Here is something I wrote, that changed
xxx.cfm?id=$id$
in to
xxx.cfm?id=123 if <cfset id = 123 />
You chould adapt it to change
"My age is #id#" to "My age is 123"
<cffunction name="EvaluateTokens">
<cfargument name="URL" type="String" required="yes">
<cfset var newQstring = "" />
<cfset urlString = ListFirst(URL,"?")>
<cfset qString = ListLast(URL,"?")>
<cfloop list="#qstring#" index="i" delimiters="&">
<!----- building the URL machinary ---->
<cfif (newQstring IS NOT "")>
<cfset newQstring = newQstring & "&" />
</cfif>
<!--- get the name and variable values --->
<cfset qStringVarname = listFirst(i,"=") />
<cfset qStringValue = listlast(i,"=") />
<!---- if the qStringValue is like $something$--->
<cfif (Right(qStringValue, 1) IS "$" AND Left(qStringValue, 1) IS "$")>
<!--- remove the "$"s --->
<cfset varname = Replace(qStringValue,"$","","all") />
<!--- if the var exists, evaluate it and use that value--->
<cfif isdefined(varname)>
<cfset newQstring = newQstring & qStringVarname & "=" &
URLEncodedFormat(Evaluate(varname))/>
<cfelse>
<cfset newQstring = newQstring & qStringVarname & "="
& qStringValue/>
</cfif>
<!---- if the qStringValue is not like $something$ --->
<!---- just add the values without any change --->
<cfelse>
<cfset newQstring = newQstring & qStringVarname & "=" &
qStringValue/>
</cfif>
</cfloop>
<cfreturn "#urlString#?#newQstring#" />
</cffunction>
-----Original Message-----
From: Mark W. Breneman [mailto:[EMAIL PROTECTED]
Sent: 16 July 2003 17:06
To: CF-Talk
Subject: RE: db records with cftags in them do not render -help
There has got to be a better way of doing this. Isn't there?
Jochem - Maybe I don't understand what you are saying. The problem I am
having is that I can not "run" a cfinclude that is in a database record. Are
you suggesting that I write 1000s of database records to files? Seems to
kinda defeat the reason we made it a contentment management system in the
first place. Or am I not understanding you correctly. :-)
I think this is the equivalent of what I am trying to do:
I have a var that holds text and 1 cf include.
<cfset foo='Here is the current results:<cfinclude template="test.cfm">' >
<cfoutput>#foo#</cfoutput>
Mark W. Breneman
>Mark W. Breneman wrote:
>> I have a database table that holds the "body" contents of a page. (simple
>> contentment management system) I just tried to put a cfinclude in a db
>> record and found that CFMX does not evaluate the code. CFMX will just
send
>> the cfinclude tag to the browser, as unrendered source code, just like
any
>> other normal html tag. Is there a way I can make CFMX render CFtags that
>> are stored in a db record?
>Write them to a file and cfinclude the file.
>> Seems like there should be an EZ way to do this.
>http://www.macromedia.com/support/email/wishform/?6213=3
>Jochem
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4