Home Services Industries Showcase Library People

 
 

 

4.4.5 Dreamweaver Code Icons

Customizing Dreamweaver for 4D's Non-Contextual Tags...

 
The problem

By default, Dreamweaver "fixes errors" found in documents when they are opened. Unfortunately, by default, it does not tell you it is doing this. Further, it believes code found within an HTML tag is an error, and it "fixes" it. For example,

<input type="radio"
<!--4dscript/w_Checked/q=74&c=36--> value="36" name="74-<!--4dscript/w_AnswerKey/qt=radio&q=74-->">

...will be rewritten as...

<input type="radio" >
<!--4dscript/w_Checked/q=74&c=36--> value="36" name="74-<!--4dscript/w_AnswerKey/qt=radio&q=74-->">

This serious problem can be fixed 1 of 2 ways. Either way, users need to be aware of the problem and be very careful about letting people with default installations of Dreamweaver touch templates with embedded code.

 
The quick and dirty solution

The first way to fix the problem is to turn off code rewriting in preferences. The advantage to this approach is that it can be done without access to special files. The disadvantage is that code rewriting is a powerful and useful feature that prevents invalid HTML from going into production.

 
A more elegant solution

The other option is to use Dreamweaver's Third Party Tags feature to tell Dreamweaver that the tags used for code (which often appear as comments) are not comments, but code. Dreamweaver does not modify code, so you maintain the useful aspects of code rewriting without damaging your templates.

To install the files you need, do a "save link as" on the following links...

  Image XML
4D 4D.gif 4D.xml
SSI ssi.gif ssi.xml
Slicksurface ssicon.gif slicksurface.xml
"jh" jh.gif jh.xml

...and save them in...

c:\program files\macromedia\dreamweaver 8\configuration\thirdpartytags

(or its equivalent on your computer). The same will work for all versions of Dreamweaver since version 3. You will then need to restart the Dreamweaver application, if it's open.

All this does is teach Dreamweaver that 4D tags are similar to ASP or ColdFusion tags. This should insure that Dreamweaver will always leave the tags undisturbed. It will also show a 4D icon instead of a comment icon.

 

If you take a look at either of the XML files you will see how easy it is to create your own custom tags in Dreamweaver.