House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

custom tags on-the-fly

  << Previous Post |  RSS |  Tree View |  Sort Oldest First |  Subscribe to this Group Next >> 

custom tags on-the-fly

...but the browser is ignoring it as unknown tag mavinson 05/26/2004 04:11 PM
You might be running into an HTML parsing issue.  I bet if you look at Ian Skinner 05/26/2004 03:23 PM
Thanks Philip, JE & Barney: I love a one-word answer ..... mavinson 05/26/2004 03:09 PM
Nope, EVAL evaluates a string.  It doesn't execute tags. J E VanOver 05/26/2004 03:00 PM
You can't do that.  If you really need to, you could write your Barney Boisvert 05/26/2004 02:59 PM
> I'm trying to build, evaluate & execute custom tags on the Philip Arnold 05/26/2004 02:57 PM
Hi, mavinson 05/26/2004 02:49 PM

05/26/2004 04:11 PM
Author: mavinson Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32808#164559 ...but the browser is ignoring it as unknown tag -- exactly. (view source confirmed your suspicion as well as mine) ...You want the CFML parser to see that tag and it is not. -- right again. ... I don't know if there is a way to do what you want, -- ah, cfmodule will allow me to effectively (and efficiently enough) allow me to gather up the state of my app and fire off the next template. ...sound a bit off kilter to me. -- Hey, I resemble that statement ;) Take care, Mike
05/26/2004 03:23 PM
Author: Ian Skinner Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32808#164535 You might be running into an HTML parsing issue.  I bet if you look at your source code you will see the output you are expecting, but the browser is ignoring it as unknown tag.  I suspect this is not the desired result.  You want the CFML parser to see that tag and it is not.  It is just sending the string down the line to the HTML output.  I don't know if there is a way to do what you want, sound a bit off kilter to me. -------------- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA "C code. C code run. Run code run. Please!"      - Cynthia Dunning Confidentiality Notice:  This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message.
05/26/2004 03:09 PM
Author: mavinson Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32808#164527 Thanks Philip, JE & Barney: I love a one-word answer ..... cfmodule.
05/26/2004 03:00 PM
Author: J E VanOver Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32808#164523 Nope, EVAL evaluates a string.  It doesn't execute tags. Try calling your tags with <CFMODULE instead of using the <cf_ syntax <cfset templateString="assign"> <cfset templateAttribs = structNew()> <cfset templateAttribs.param1 = "foo1"> <cfset templateAttribs.param2 = "foo2"> <cfmodule template="#templateString#.cfm" attributeCollection="#templateAttribs#">   Hi,   I'm trying to build, evaluate & execute custom tags on the fly by creating   a string ( e.g. "<cf_myTag param1='foo1' param2='foo2'>" ). After toying   with the concept, I'm wondering if a) There's something I simply do not   grasp and/or b) This is generally a silly idea and I need to get on with   the business of writing some case statements.   Here's a few tests & results (using CF 5.0):   <!--- assign.cfm is a working template --->   <cfset templateString = "<cf_assign>">   <cfoutput>           templateString = #templateString#<br>           #templateString#   </cfoutput>   This returns an empty string and doesn't run assign.cfm. As CF doesn't   have escape characters, my guess is that CF is "blowing off" a tag that   doesn't exist (failsafe thingy?).   So then I break out evaluate() whose inner workings I best comprehend   through monkey motion (trial and error):   <cfset templateString = "<cf_assign>">   <cfoutput>evaluate(#templateString#)</cfoutput>   This evaluates to nothing, null, nada... So I change the hash-marks:   <cfset templateString = "<cf_assign>">   <cfoutput>#evaluate(templateString)#</cfoutput>   And CF returns an error (evaluating the expression: <cf_assign>) ... at least this is the string that I intended - but not the   result.   Any input appreciated,   Thanks, Mike
05/26/2004 02:59 PM
Author: Barney Boisvert Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32808#164522 You can't do that.  If you really need to, you could write your dynamic string to a file, and then include that file, but that'll be slow, becaue CF will have to compile the file on every request. Cheers, barneyb ----- Excess quoted text cut - see Original Post for more -----
05/26/2004 02:57 PM
Author: Philip Arnold Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32808#164520 > I'm trying to build, evaluate & execute custom tags on the > fly by creating a string No - it won't do it CFML is compiled into P-Code (for upto CF5) and Java (for CFMX), so it can't "compile and run a template" on the fly If you want to run a template like that, then use CFMODULE, you can specify the template name via a variable
05/26/2004 02:49 PM
Author: mavinson Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32808#164518 Hi, I'm trying to build, evaluate & execute custom tags on the fly by creating a string ( e.g. "<cf_myTag param1='foo1' param2='foo2'>" ). After toying with the concept, I'm wondering if a) There's something I simply do not grasp and/or b) This is generally a silly idea and I need to get on with the business of writing some case statements. Here's a few tests & results (using CF 5.0): <!--- assign.cfm is a working template ---> <cfset templateString = "<cf_assign>"> <cfoutput>         templateString = #templateString#<br>         #templateString# </cfoutput> This returns an empty string and doesn't run assign.cfm. As CF doesn't have escape characters, my guess is that CF is "blowing off" a tag that doesn't exist (failsafe thingy?). So then I break out evaluate() whose inner workings I best comprehend through monkey motion (trial and error): <cfset templateString = "<cf_assign>"> <cfoutput>evaluate(#templateString#)</cfoutput> This evaluates to nothing, null, nada... So I change the hash-marks: <cfset templateString = "<cf_assign>"> <cfoutput>#evaluate(templateString)#</cfoutput> And CF returns an error (evaluating the expression: <cf_assign>) ... at least this is the string that I intended - but not the result. Any input appreciated, Thanks, Mike
<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 24, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
     1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31     

Designer, Developer and mobile workflow conference