• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Extending or modifying of CF tags behaviour

New Here ,
May 24, 2006 May 24, 2006

Copy link to clipboard

Copied

May be it's just a dream but...
Is it possible to change defined behaviour of ColdFusion's tags?

For example, I'd like to modify behaviour of CFINCLUDE.
Now it can include templates only. Is it possible to extend CFINCLUDE's functionality and insert name of template as HTML comments?

Now:

1 This is CF code
2 <CFINCLUDE template="abc.cfm">
3 Continue with CF code

and generated HTML will look like
1 This is CF code
2 This line from included file
3 Continue with CF code

but I like to generate HTML with name of included template:
1 This is CF code
2 <!-- abc.cfm -->
3 This line from included file
4 Continue with CF code

Second example, I like to modify behaviour of CFOUTPUT

This is CF code:

1 <CFSET myVar = "Dream">
2 <CFOUTPUT>
3 #myVar#
4 #Len(myVar)#
5 </CFOUTPUT>

HTML code:

1 Dream
2 5

... and wishful HTML:
1 <span title="myVar">Dream</span>
2 <span title="Len(myVar)">5</span>

So, if you point to word "Dream" in web browser you'll see tip "myVar". If you point to digit "5" then you'll see tip "Len(myVar)"

I think it should be very useful to debug applications or to investigate foreigner code, but how to do that?

Thank you!
TOPICS
Advanced techniques

Views

236

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 25, 2006 May 25, 2006

Copy link to clipboard

Copied

No any ideas? 😞

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 25, 2006 May 25, 2006

Copy link to clipboard

Copied

For the cfinclude, apparently if you do this
<!-- abc.cfm -->
<cfinclude template="abc.cfm">

then the comment will show up if you do a view source on the web output. At least that's how I interpreted the recent thread on html comments vs cf comments.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 25, 2006 May 25, 2006

Copy link to clipboard

Copied

LATEST
Correctly.
I'd like to get HTML comments when view source to know areas of different cfincludes

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation