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.

  • Dreamweaver parses the code in includes, hence rendering can be slowed down in Design view.
  • The Server Behaviors panel may take longer to load.
  • If you work with others who use Dreamweaver's Server Behaviors panel a lot, but they won't have any reason to touch your code you can hide it from them this way. (Sure, they can get around this but I mean hiding it from a Designer who might mess things up.)
  • If you're doing conditionial logic and showing includes with an if/else or switch case, Dreamweaver will render all of the includes. Having all includes render at once could distort what the layout might look like if only one were showing. So you could disable includes using this trick and only enable the one you need to see.

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. ;-)