Kay lives here

working with the web

Dreamweaver Fusedocs

I’m a bit of a code col­or­ing fanatic, so one of the first things I did with Dreamweaver was try to work out how to get around commented-out fuse­docs tak­ing on the commented-out color and style. It took a bit of exper­i­men­ta­tion, count­less restarts of the pro­gram, and a lit­tle help from some­one with inside knowl­edge, but it works and it also allows you to set dif­fer­ent colours and styles for text, tags, attrib­utes and values.

This was orig­i­nally posted on the fusewiki but that site has been pretty flaky lately, so here it is.

Nicely Coloured Dreamweaver Fusedocs

If you’re work­ing with Fuse­Docs a lot in Dreamweaver, you’ll want to have use of the tag com­ple­tion and tag insight fea­tures, cus­tom colours, and the abil­ity to com­ment out your Fuse­Docs so they are not sent to the browser, with­out los­ing your cus­tom colour cod­ing or alter­ing the nor­mal behav­iour of CF comments.

Luck­ily, Dreamweaver is extremely customisable.

Note: These instruc­tions are for Cold­Fu­sion. For PHP sup­port, mark the PHP box on the Tag Libraries->Fusebox DTD “Uses In:” box and add PHP_MySQL to the doc­types para­me­ter of the block­Start tag in the Code Col­or­ing snippet.

  1. Firstly you need to have imported the Fuse­Doc DTD into the Tag Library. If you haven’t done this, go to the Edit menu within DWMX and select Tag Libraries. Click the plus icon in the top left hand cor­ner and select DTD­Schema — Import XML DTD or Schema File. In the sup­plied space, enter the URL of the Fuse­Doc DTD — http://www.fusebox.org/fd4.dtd — or you can browse for the file if you have a local copy. The tag pre­fix is not a require­ment, but it might be a good idea — there have been threads about this issue on the Fuse­box mail­ing list, check them out if you are interested.You are now returned to the Tag Library Edi­tor, with the newly imported DTD open in the tree. Make sure the Cold­Fu­sion check­box is ticked in the “Used in:” box — this is really impor­tant! If you want to add some default val­ues to any of the attrib­utes (your name for the author in the his­tory tag, for exam­ple) you can do this from this dialog.
  2. Close DWMX. Now you need to open Dreamweaver’s Codecoloring.xml file. To pre­vent the uni­verse implod­ing, it’s prob­a­bly bet­ter not to edit this file in Dreamweaver itself. I did all of my experiements just using Notepad. On Win2K and XP, the file will by default be in:drive:\Documents and Settings\USername\Application Data\Macromedia\Dreamweaver MX\Configuration\Codecoloring

    I’m not sure about where Win98 keeps these files — if some­one wants to let me know I’ll update this page. Is any­one still using Win98 anyway?

    And make sure you have a backup!

    Add to Codecoloring.xml (put it any­where after the openingtag):

    Yes
    No

    <![CDATA[

    <![CDATA[“]]>

    <![CDATA[“]]>

    <![CDATA[]]>

    Save and close Codecoloring.xml.

  3. Open DWMX. Open Edit -> Pref­er­ences, select Code Col­or­ing. Select Cold­Fu­sion as the doc­u­ment type and click Edit Col­or­ing Scheme.You will now have four extra entries in the “Edit Col­or­ing Scheme for Cold­Fu­sion” dialog:
    • Fuse­Doc tags (fuse­doc, respon­si­bil­ties, prop­er­ties etc)
    • Fuse­Doc Text: text not con­tained within a tag, such as the text in the respon­si­bil­i­ties section.
    • Fuse­Doc Attribute: any attribute (fuse, lan­guage, spec­i­fi­ca­tion, author etc)
    • Fuse­Doc Attribute Value: any­thing within dou­ble quotes

    Change these col­ors to what­ever you want for your Fuse­Docs. Then click OK. And that’s it!