Customizing Dreamweaver > Creating a simple object

 

Creating a simple object

You can create your own objects to add to the Objects panel. Many simple objects require no JavaScript; they contain only the HTML source code to be inserted into the document. (For basic information about creating more complex objects using JavaScript, see Extending Dreamweaver: Basics.)

After you create an object, you can package it and distribute it on the Macromedia Exchange site if you want other Dreamweaver users to be able to use it. For more information, see the Macromedia Exchange for Dreamweaver site. To package an extension, you must first download the Extension Manager installer from that site, then install the Extension Manager.

To create a simple object:

1 Create a new blank document in a text editor (such as BBEdit or HomeSite).
Note: When you create a new blank document in Dreamweaver, it contains several default HTML tags, such as html, head, and body. If you want to use one of Dreamweaver's code editors (the Document window's Code view or the Code inspector) as your text editor for creating a simple object, you must first delete all the default tags that appear in the code editor when you create a new document.
2 Add the tags that you want this object to insert into your documents.
For example, type the following:
<p>
&copy; 2000 Z Productions, Inc.<BR>
All Rights Reserved
</p>
3 Save the file.
If you want the new object to appear in one of the existing Objects panel categories, save it in one of the subfolders of the Objects folder. To create a new category, create a new folder within the Configuration/Objects folder and save your file there. Additional folders inside any category subfolder (such as folders created inside the Characters subfolder) are ignored.
4 In a graphics or image-editing application (such as Macromedia Fireworks), create an 18 x 18 pixel GIF image that will serve as the icon for your object in the Objects panel.
If you create a larger image, Dreamweaver automatically scales it to 18 x 18 pixels. If you do not create an icon for your object, Dreamweaver displays a generic object icon for your object in the Objects panel.
5 Give your icon the same file name as your object file, but use .gif as the extension; then save the icon in the same directory as the object file.
For example, if your object is called Copyright_Z.htm and you saved it in the Common directory, name your icon Copyright_Z.gif and save it in the Common directory as well.
6 Restart Dreamweaver, or reload extensions, to use your new object.
The object appears at the bottom of the Insert menu as well as on the Objects panel. (For information on reloading extensions, see Modifying the Objects panel.)