ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old November 19th, 2004, 12:37 PM
webacadie webacadie is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Location: Caraquet, New-Brunswick, Canada
Posts: 9 webacadie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Using a cf variable inside a cf variable

I'm currently developping a website 100% CF dynamic my problem is that I want to do some CF inside a CFoutput variables.

Example:
<cfquery datasource="mydatasource" name="content">
<cfoutput query="content">#mytext#</cfoutput>


-----

and inside the mytext the data would be:

bla bla bla

<cfmail ...> lkshalkjfhkj</cfmail>

---

I want my CFmail to work not to only write the text "<cfmail>"


Is this just impossible with Cold Fusion or is there a trick I don't know

Reply With Quote
  #2  
Old November 19th, 2004, 01:02 PM
bocmaxima's Avatar
bocmaxima bocmaxima is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Aug 2004
Location: Tucson, Sonora
Posts: 1,316 bocmaxima User rank is Sergeant (500 - 2000 Reputation Level)bocmaxima User rank is Sergeant (500 - 2000 Reputation Level)bocmaxima User rank is Sergeant (500 - 2000 Reputation Level)bocmaxima User rank is Sergeant (500 - 2000 Reputation Level)bocmaxima User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 16 h 48 m 13 sec
Reputation Power: 22
Send a message via AIM to bocmaxima
You may have to elaborate because what you wrote is a little hard to follow.
<cfmail> can be nested in a <cfoutput> without issue, however it cannot be nested inside a <cfquery>.
You are also not allowed to output a string with #'s and expect CF to process the code. By outputting the string, CF is already processing the code, and once it's done, it's done and it moves on.
Try using Eval(mytext) and it may process the code, although there's no guarantee.
I would just make this a function and send the stuff that way.

Reply With Quote
  #3  
Old November 19th, 2004, 01:26 PM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,492 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 18 h 25 m 21 sec
Reputation Power: 44
Yes what you're asking for doesn't really make sense. You want to output an entire <cfmail> tag set as text and have the CF engine process it? I don't think it's possible, but the real question is, why would you do this?
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #4  
Old November 19th, 2004, 01:40 PM
webacadie webacadie is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Location: Caraquet, New-Brunswick, Canada
Posts: 9 webacadie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I want to do this because all of my website is 100% dynamic, all my website is working from my index.cfm and contenu.cfm page, the reste is all query. All my menu are load via my id , all my different header are loading via that IP.

What I want to do is to have my "Contact us" form in the page contenu.cfm?id=10 and when I submit my form I want it to call "contenu.cfm?id=11" and in that I would have my cfmail tag inside mytext variables
--
<cfquery datasource="mydatasource" name="content">
Select mytext from content
where id = #url.id#
</cfquery>

<cfoutput query="content">#mytext#</cfoutput>


I know that this is probably impossible, but is I don't ask I will never be sure, there always somebody smarter somewhere, it don't mean that if we don't know that nobody know.

I will probably have to hard code some of my page and that piss me off.

Quote:
Originally Posted by kiteless
Yes what you're asking for doesn't really make sense. You want to output an entire <cfmail> tag set as text and have the CF engine process it? I don't think it's possible, but the real question is, why would you do this?

Reply With Quote
  #5  
Old November 19th, 2004, 02:09 PM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,492 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 18 h 25 m 21 sec
Reputation Power: 44
Yes, first, it's impossible because CF compiles to Java classes prior to runtime.

Second, no offense but that is a very bad idea in and of itself. Not only would such a site be agonizingly slow because all the code would have to be handled at runtime AFTER all the queries had run, but maintaining it would be a nightmare.

Let me put it this way: could you imagine doing this with Java or C#? No way.

A better approach would be to code yourself well abstracted, encapsulated and reusable code files either as cfm files, custom tags, or CFCs. The n-tier approach has become popular among the CF folks...

Reply With Quote
  #6  
Old November 19th, 2004, 02:17 PM
webacadie webacadie is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Location: Caraquet, New-Brunswick, Canada
Posts: 9 webacadie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Wink

Thanks for your comment

I guess i'll move on with reusable cfm files.

I know that my idea sound silly, but for us, that have the full picture of our website, it's not that silly. I guess technology is still not strong enough to process this. Maybe one day.

Quote:
Originally Posted by kiteless
Yes, first, it's impossible because CF compiles to Java classes prior to runtime.

Second, no offense but that is a very bad idea in and of itself. Not only would such a site be agonizingly slow because all the code would have to be handled at runtime AFTER all the queries had run, but maintaining it would be a nightmare.

Let me put it this way: could you imagine doing this with Java or C#? No way.

A better approach would be to code yourself well abstracted, encapsulated and reusable code files either as cfm files, custom tags, or CFCs. The n-tier approach has become popular among the CF folks...

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Using a cf variable inside a cf variable


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway