Extending Dreamweaver

 
Developed by Craig A. Cunningham
 

Key concept: Dreamweaver itself is written in a code that can be modified or extended using JavaScript. Nearly ANYTHING in Dreamweaver can be changed, provided you know what you're doing. Some changes you might want to make:

  • Set preferences for many, many things (See Edit|Preferences.)
  • Change keyboard shortcuts (choose Edit|Keyboard Shortcuts.)
  • Create a new command by saving a series of history steps. (Select a set of steps in the History panel and right-click or ctrl-click (Mac) and then choose "Save As Command" from the context menu. Whatever you name it will then chow in the Commands menu.) You can also edit the names of commands by clicking Commands|Edit Command List.
  • Record a new command for short-term use. (Choose Commands|Start Recording. When done' choose Commands|Stop Recording. To play, choose Commands|Play Recorded Command.) To save a recorded command, play it back. A Run Command will appear in the history panel. Select that step and right-click or control-click (Mac) and choose Save as Command.
  • Rearrange the Objects panel. (The categories in the objects panel corrspond to folders in the Configuration/Objects folder in the Dreamweaver application folder. To rearrange, move object files -- usually a *.gif, an *.htm, and sometimes a *.js -- into the folder you want.)
  • Create your own objects for the object panel. This requires a text editor to create an *.htm file containing the only code you want to insert (no "html," "head" or "body" tags), and saving this into a Configuration/Objects folder. (Look at an existing objects *.htm file to see what I mean.) You'll also need an 18x18 *.gif file for the button.
  • Remove an object from the Objects panel by deleting (or better, moving to another place on your system) the files in a Configuration/Objects folder.
  • Restructure the menus (by editing the menus.xml file in a text editor such as notepad or simpletext in the Configuration/Menus folder). This is fairly complicated. See the user guide (Help|Using Dreamweaver), and make a backup first!
  • Add extensions from the Macromedia web site at http://www.macromedia.com/exchange/dreamweaver.

For more information on any of these, choose Help|Extending Dreamweaver.

Back to the top.

Activity

Let's go to the Exchange and download a command now.

Set your browser to http://www.macromedia.com/exchange/dreamweaver.

If this is your first time at the Exchange, you'll have to create a membership. Choose "Get a Macromedia ID."

Fill out the form. When you're done, make sure you write down your member name and password.

Go back to Exchange home page, and log in (if necessary). Let's Browse the extensions, all categories.

The Anchors extension (by Scott Richards) works well. Let's get it and use it. Click on it.

Extension Manager is already part of Dreamweaver 4.0 so we don't need it. Simply choose your platform and click the icon to download the extension. Make sure you choose "Save" instead of open. Put it in the Dreamweaver\Downloaded Extensions folder.Remember the name!

Choose Commands|Manage Extensions. Then choose File|Install Extension. The new one should show up on the list. Choose it. and click OK. It should now install.

Once installed, this extension is available now. (Some require you to restart Dreamweaver.) Let's create a simple page to test it on. The page will have a bunch of anchors, like this one. Create five anchors, with a few blank lines between them, and some labels. (Don't make the menu choices yet.)

(To create anchors, choose Insert|Invisible Tags|Named Anchor or use the ctrl-alt-a shortcut.)

NOTE: When you create a new anchor using the CTRL-ALT-A shortcut, the anchor is SELECTED after it is created. Don't type "Enter" to go to the next line or the anchor will be deleted. Press right-arrow and THEN Enter to make a new line.

Back to the top.

Now click the "Goodies" object on the Object panel. (If the panel is not visible, choose Window|Objects.) The drop-down menu on the panel includes a choice for "Goodies."

Place your cursor at the top of your page and Type "Menu" and make it a heading.

When you choose the "Anchors" object, you get a dialog box with a drop-down menu in which you can choose which anchor to link to and what the link text will be:

This extension will always be available in the copy of Dreamweaver you're now using, unless it gets reinstalled from the CD.

Back to the top.

Activity

Download another extension from the extension manager and install it. Make sure it works.

Back to the top.

 

Developed by Craig A. Cunningham