Current Filter:
Category: ColdFusion
Date Range: 1/15/2006
(clear filters)

Sunday, January 15, 2006

<cfinclude /> Rendering Trick for Dreamweaver

Here's a tip for you if you don't want Dreamweaver to render a specific <cfinclude> tag in Design view. Look at the tag in the previous sentence. Now go back and look at the tag in this subject line. Spot the difference?

If you close a cfinclude tag as if it were an empty element like in XHTML, Dreamweaver does not render the contents of the cfinclude.

This won't render in Design view:
<cfinclude template="/includes/header.cfm" />

This will render in Design view:
<cfinclude template="/includes/header.cfm">

Why wouldn't you want Dreamweaver to render a cfinclude you ask? Oh, I can come up with a lot of reasons... I'll give you but a few of them.

If anyone cares to share some potential uses for this trick, please be sure to leave a comment.

To any Adobe employees reading this blog post: Please do not "fix" the translator to account for the space and closing slash. This is not a bug; its an undocumented feature. ;-)

Posted by ~Angela | Comments (5) | Add Comment | Permalink