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"
type="
Suite" requires-restart="True">
<products>
<product name="
Dreamweaver" version="6" primary="true" />
</products>

<author name="
Luis Matthews" />

<description>
<![CDATA[A custom tag definition for CF_ourtemplate]]>
</description>

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.

<files>
<file source="
cf_ourtemplate.htm"
destination="
$dreamweaver/configuration/Taglibraries/ourTags" />
<file source="
cf_ourtemplate.vtm"
destination="
$dreamweaver/configuration/Taglibraries/ourTags" />
<file source="
TagChooser.xml"
destination="
$dreamweaver/configuration/Taglibraries/ourTags" />
<file source="
Reference.xml"
destination="
$dreamweaver/Configuration/Content/Reference/our/" />
<file source="
default.htm"
destination="
$dreamweaver/Configuration/Content/Reference/our/" />
<file source="
ourtemplate.htm"
destination="
$dreamweaver/Configuration/Content/Reference/our/" />
</files>

Finally, we tell Dreamweaver what type of files our tag is used for, and what .vtm files to use.

<configuration-changes>
<taglibrary-changes>
<taglibrary-insert>
<taglibrary doctypes="
ColdFusion,CFC,DWTemplate_CF" id="ourTags"
name="
Our Tags" servermodel="Cold Fusion"
tagchooser="
ourTags/TagChooser.xml">
<tagref file="
ourTags/cf_ourtemplate.vtm" name="cf_ourtemplate" />
</taglibrary>
</taglibrary-insert>
</taglibrary-changes>
</configuration-changes>

</macromedia-extension>

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.

Labels: , , ,

posted by Luis

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home

Template design by MLP Design
Licensed under CC-NC 3.0