spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / new / dwextend
Developer News
ActiveState Debuts Open Source Business Suite
Salesforce Offers Visual App Builder
Codesion Steps Out From CVS's Shadow

Extending Dreamweaver

Macromedia Dreamweaver has long been my 'editor of choice' for creating Web sites. Every editing program I've used has had its limitations but Macromedia appears to have found a way to make its Web authoring tool almost limitless: they let you build it yourself.

The Dreamweaver program itself is built using HTML, JavaScript and XML; just like a Web page. This means that early Dreamweaver users were able to extend the abilities of the program and add commands and menu items that didn't exist. (it was possible, but it wasn't easy.) Macromedia has since started its 'Dreamweaver Exchange', making it as simple as downloading and double clicking the command you want to add. And some of these commands are pretty advanced.

Some of my favorites: A self-centering pop-up window. A premade calendar. JavaScript form field validation.

Advanced JavaScripts that used to take an hour to hand code now take me a couple clicks. You don't even need to KNOW JavaScript to add advanced features to your page. What you DO need:

A copy of Dreamweaver. A copy of Extensions Manager.

Here's where to find extensions:

Authorized*:

http://www.macromedia.com/exchange/dreamweaver/

Other*:

http://www.yaromat.com/ http://people.netscape.com/andreww/dreamweaver/customtags.html http://www.massimocorner.com/ http://www.projectseven.com/dreamweaver/index.htm http://dreamweaverfever.com/grow/ http://thecomb.tripod.com/dream.htm

Authorized Extensions vs. Unauthorized ones:

There are two kinds of extensions, 'authorized' and 'unauthorized.' Authorized means that the good people of Macromedia have checked it out and it appears to do what it says without causing any problems. Unauthorized means that it may work or it may give you errors. I've found a few that gave me errors but not many.

But I Want To Build My Own!

You can do this too. The easiest way is to find out how other people did it. Find an extension similar to yours, install it with Extensions Manager, then go looking for it on your hard drive. When I download an extension it usually ends up in C:\Program Files\Macromedia\Dreamweaver 3\Configuration\Objects\Invisibles.

A simple extension (or MXP file) is made up of three or four parts, with lots of variations:

  1. The HTML file that calls the JavaScript.
  2. The GIFs used
  3. The JavaScript that does the work.
  4. The MXI file that tells Extensions Manager who built it, what it is, and where to install it.

Here's a simple MXI File to insert a 'JavaScript back button'. Note that this is only one of the three files needed to build an extension:

<macromedia-extension id="99999" name="JavaScript Back Button" version="1.0.0" type="Object"> <!-- List the required/compatible products --> <products> <product name="Dreamweaver" version="3" primary="true" /> </products> <!-- Describe the author --> <author name="Danny Mather" /> <!-- Describe the extension --> <description> <![CDATA[Inserts a javascript 'back' link with text of your choice. ]]> </description> <!-- Describe where the extension shows in the UI of the product --> <ui-access> <![CDATA[Access this object from invisibles in the object palette ]]> </ui-access> <!-- Describe the files that comprise the extension --> <files> <file name="javaback.html" destination="$dreamweaver/configuration/objects/invisibles" /> <file name="javaback.gif" destination="$dreamweaver/configuration/objects/invisibles" /> </files> <!-- Describe the changes to the configuration --> <configuration-changes> </configuration-changes> </macromedia-extension>

If you look between the ' ' tag you can see where it tells Extensions Manager where to install the HTML file within the Dreamweaver folder.

TEXT CONTENT FOR JAVASCRIPT_BACK_BUTTON.HTML

<html> <head> <!-- Created by Danny Mather, 12.05.2000, Object Name: Javascript Back Button:Text --> <!-- Copyright 1999 Macromedia, Inc. All rights reserved. --> <title>JavaScript Back Button</title> <STYLE TYPE="text/css"> <!-- FORM.tb {display:inline;} .twidth{width:100%} .include{ font-size: 75%; font-family: verdana, arial, helvetica;} .includebig{font-family: verdana, arial, helvetica;} .includebig A:link { color: blue; } .includebig A:visited { color: purple; } .include A:link { color: blue; } .include A:visited { color: purple; } .submitter { font-size: 75%; font-family: verdana, arial, helvetica; } .codehighlight {background:#eee} .WRy1{background:#fc0} .WRy2{background:#fff3ac} pre.code {color: #660099; margin-left:5%} address {text-align: right} a:hover{background:#FD3;} a.small, .small A { font-family: Verdana, Helvetica, sans-serif; font-size: 10px; font-weight: normal; text-decoration: none; color: #000000; } A:link.small, .small A:link { font-family: Verdana, Helvetica, sans-serif; font-size: 10px; font-weight: normal; text-decoration: none; color: #000000; } A:visited.small, .small A:visited { font-family: Verdana, Helvetica, sans-serif; font-size: 10px; font-weight: normal; text-decoration: none; color: #000000; } A:hover.small, .small A:hover { font-family: Verdana, Helvetica, sans-serif; font-size: 10px; font-weight: normal; text-decoration: underline; color: #CC0000; } body {background:#FFFFFF; margin-left: 5%; margin-right: 5%} .WRBannerCenter {margin-left:-5%; margin-right:-5%; margin-top:8px; margin-bottom:8px; text-align:center} --> </STYLE> <STYLE TYPE="text/css"> <!-- FORM.tb {display:inline;} .twidth{width:100%} .include{ font-size: 75%; font-family: verdana, arial, helvetica;} .includebig{font-family: verdana, arial, helvetica;} .includebig A:link { color: blue; } .includebig A:visited { color: purple; } .include A:link { color: blue; } .include A:visited { color: purple; } .submitter { font-size: 75%; font-family: verdana, arial, helvetica; } .codehighlight {background:#eee} .WRy1{background:#fc0} .WRy2{background:#fff3ac} pre.code {color: #660099; margin-left:5%} address {text-align: right} a:hover{background:#FD3;} a.small, .small A { font-family: Verdana, Helvetica, sans-serif; font-size: 10px; font-weight: normal; text-decoration: none; color: #000000; } A:link.small, .small A:link { font-family: Verdana, Helvetica, sans-serif; font-size: 10px; font-weight: normal; text-decoration: none; color: #000000; } A:visited.small, .small A:visited { font-family: Verdana, Helvetica, sans-serif; font-size: 10px; font-weight: normal; text-decoration: none; color: #000000; } A:hover.small, .small A:hover { font-family: Verdana, Helvetica, sans-serif; font-size: 10px; font-weight: normal; text-decoration: underline; color: #CC0000; } body {background:#FFFFFF; margin-left: 5%; margin-right: 5%} .WRBannerCenter {margin-left:-5%; margin-right:-5%; margin-top:8px; margin-bottom:8px; text-align:center} --> </STYLE> </head> <script language="javascript"> function objectTag() { // Return the html tag that should be inserted return '<a href="javascript:history.back();">' + document.forms[0].jback.value + '</a>'; } </script> <body> <form name="theform"> <table border=0> <tr> <td nowrap>&nbsp;&nbsp;Enter text for back button: <br> <textarea name="jback" cols="30" rows="1" wrap="virtual"></textarea> </td> </tr> </table> </form> </body> </html>

Once you've created the files needed for your extension to work you use Dreamweaver's 'Package' function. It'll ask you where your MXI file is and then compress these three files into a single MXP file ready for installation.

There are tons of handy exensions available for download at Macromedia and more being created every week. Let's see some of yours up there too!

Danny Mather is a Web and flash developer for nject creative based in Vancouver, BC, Canada. He can be reached at mailto:danny@nject.com and http://nject.com/.

This article originally appeared in the Jan. 4, 2000 edition of the WebReference Update Newsletter.


Comments are welcome


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

webref The latest from WebReference.com Browse >
Use Web Caching to Make Your Web Site Faster · Creating an Online Shopping Cart Mechanism in PHP · Log JavaScript Errors Using an AJAX-driven Web Service
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Configuring Granular Settings for a Database Level Audit · The Perils of a Web 2.0 Transition on Your Business Processes · Facebook Redesigns Site —Again — Nears 400M Mark


Revised: Jan. 5, 2001

URL:http://www.webreference.com/new/dwextend.html