Tuesday, September 04, 2007
Documenting ColdFusion custom tags in Dreamweaver (4/4)
Part 4: Creating the Dreamweaver Extension
In part 2 we created our tag editor; in Part 3 we created our documentation. In this part we package these files up as a Dreamweaver extension. To create the extension we start with a .mxi file. Editing .mxi files can be tricky in Dreamweaver. I usually create the file as .xml, then rename it when I'm ready to create my extension. We begin by defining the name, version, Dreamweaver version required, author and description of our extension.
<macromedia-extension name="Our Template Extension" version="1.0"
<product name="Dreamweaver" version="6" primary="true" />
<author name="Luis Matthews" />
<![CDATA[A custom tag definition for CF_ourtemplate]]>
Next we tell Dreamweaver where to place the files we created. Some of our files go into the Taglibraries directory, others go into the Reference directory.
Finally, we tell Dreamweaver what type of files our tag is used for, and what .vtm files to use.
<taglibrary doctypes="ColdFusion,CFC,DWTemplate_CF" id="ourTags"
name="Our Tags" servermodel="Cold Fusion"
<tagref file="ourTags/cf_ourtemplate.vtm" name="cf_ourtemplate" />
Once our .mxi is created, we simply open the Macromedia Extension Manager, Choose File->Package Extension, Select our .mxi file and let the extension manager create the extension. Once this is complete, you can double-click your .mxp file to install your extension.
I hope that you found this series useful. There is a lot more that can be done with Dreamweaver Extensions and ColdFusion Custom Tags. Custom Tags have had a bit of a bum rap in recent years, but I believe that they still can be quite useful in the right situation.posted by Luis