Creating a library item

Creating a library item

You can create a library item from any element in the body section of a document, including text, tables, forms, Java applets, plug-ins, ActiveX elements, navigation bars, and images.

For linked items such as images, the library stores only a reference to the item. The original file must remain at the specified location for the library item to work correctly.

It can still be useful to store an image in a library item, though; for example, you could store a complete img tag in a library item, which would allow you to easily change the image’s alt text, or even its src attribute, throughout the site. (Don’t use this technique to change an image’s width and height attributes, though, unless you also use an image editor to change the actual size of the image.)

To create a library item based on a selection:

  1. In the Document window, select a portion of a document to save as a library item.
  2. Do one of the following:
    • Drag the selection into the Library category of the Assets pane (Window > Assets).
    • Click the New Library Item button at the bottom of the Library category of the Assets panel (Window > Assets).This is a picture of the feature being described.
    • Select Modify > Library > Add Object to Library.
  3. Type a name for the new library item, then press Enter (Windows) or Return (Macintosh).

    Dreamweaver saves each library item as a separate file (with the file extension .lbi) in the Library folder of the site’s local root folder.

To create an empty library item:

  1. Make sure nothing is selected in the Document window.

    If something is selected, it will be placed in the new library item.

  2. In the Assets panel (Window > Assets), select the Library category on the left side of the panel.This is a picture of the feature being described.
  3. Click the New Library Item button at the bottom of the Assets panel.This is a picture of the feature being described.

    A new, untitled library item is added to the list in the panel.

  4. While the item is still selected, enter a name for it, then press Enter (Windows) or Return (Macintosh).

Related topics

  • Inserting a library item in a document
  • Editing a library item
  • Setting library highlighting preferences

Getting Started with Dreamweaver
Dreamweaver Basics
Working with Dreamweaver Sites
Managing Your Files
Laying Out Pages
Adding Content to Pages
Working with Page Code
Preparing to Build Dynamic Sites
Making Pages Dynamic
Developing Applications Rapidly