Accessibility
 
Home / Products / UltraDev / Support / Adding Dynamic Content
Dreamweaver UltraDev Icon Macromedia Dreamweaver UltraDev Support Center - Customizing Dreamweaver UltraDev
Writing a tag file in UltraDev

You can write tag files in UltraDev, ColdFusion Studio, or in any text editor.

1 In UltraDev, switch to the Site window (Site > Site Files), choose your ColdFusion site, then choose File > New File.
A new file appears at the end of your application files in the Local Folder pane.

2 Enter a new name for the file, make sure it has a cfm extension, and click the file icon to implement the change.
The tag file must have a .cfm extension or the server will not process it.
3 Double-click the new tag file to open it.
If the file opens in Design view—that is, if the page is completely blank—switch to Code view by pressing Control-Tab (Windows) or Option-Tab (Macintosh).
UltraDev provides another way to work with code: the Code inspector. To use the Code inspector, press the F10 key. Here's a new tag file called the ExchRateCaculator.cfm open in the Code inspector:

Strip all the HTML from the file and type your ColdFusion code. Here's the code for the ExchRateCalculator.cfm tag file:

The code in the above example converts a price quoted in Canadian dollars, Japanese yen, or British pounds into a price quoted in U.S. dollars. First, the values of two attributes are retrieved from the <cfmodule> tag and stored in the following variables:

<cfset amount = attributes.price>
<cfset rate = attributes.exchange>

The code then determines what exchange rate to use for the calculation, performs the calculation, and writes HTML text that displays the result.

After writing the tag file, you can save it anywhere on your application server or in the CustomTags folder in the default ColdFusion folder. The next section describes each option.

To Table of Contents Back to Previous document Forward to next document