DekGenius.com
Previous Section Next Section

9.2 Modifying Library Items

Library items can be edited, renamed, and deleted. When an original library item changes, you can update any instances of the item within the current document or across the entire site. To update the library items in the current document, use Modify figs/U2192.gif Library figs/U2192.gif Update Current Page; to update the library items in the entire site, use Modify figs/U2192.gif Library figs/U2192.gif Update Pages (these options work in Design view but not Code view). Dreamweaver uses the Update Pages dialog box, as seen in Figure 9-4, when updating pages sitewide.

Figure 9-4. The Update Pages dialog box
figs/dwn_0904.gif

9.2.1 Editing Library Items

Library items are stored in .lbi files in the Library folder within the site's root folder. These files contain plain text and can be edited like any typical HTML document. To edit a library item, double-click its name in the Library panel, or select it and then click the Open button in the Property inspector (see Figure 9-3). Either gesture opens the Library item as a separate HTML window, as shown in Figure 9-5 (note the words <<Library Item>> in the Document window's title bar).

Figure 9-5. Editing a library item as an HTML document
figs/dwn_0905.gif

You can modify the Library item in the same way as any other HTML document, provided you don't add any head content, such as CSS styles or behaviors. Doing so will add <style> tags outside of the <head> tag, which is not HTML 4.0-compliant (although IE5.5, NN6, and Opera 5 seem to tolerate such transgressions).

9.2.2 Deleting and Re-creating Library Items

To delete a library item, select it in the Library panel and use the Delete icon in the lower-right corner of the window. Deleting a library item does not remove instances of it from existing pages where it was used; instead, it essentially detaches the library item from all documents that use it.

If you have accidentally deleted a library item, you can re-create it from an instance of the item. Select the entire item, including the <!-- #BeginLibraryItem --> and <!-- #EndLibraryItem --> comment tags, and then click the Recreate button in the Property inspector (see Figure 9-3).

You can't re-create a library item from a detached instance. Instead, you'll need to save the library item again by using Modify figs/U2192.gif Library figs/U2192.gif Add Object to Library and giving it the same name as the original.

9.2.3 Library Operation Summary

Table 9-1 summarizes the Library operations.

Table 9-1. Library operations

Operation

Commands

Open Library panel

Window figs/U2192.gif Library or click Library icon in Assets panel.

Edit existing library item[1]

Double-click filename in Library panel, or use File figs/U2192.gif Open (Files of Type Library files).

Create a new library item[1]

Modify figs/U2192.gif Library figs/U2192.gif Add Object to Library;

Ctrl+Shift+B (Windows);

Cmd+Shift+B (Macintosh).

Insert library item into document[1]

Click Insert icon in Library panel or drag and drop from Library panel into Document window.

Delete library item[1]

Select item in Library panel and press Delete key.

Rename library item[1]

Select item in Library panel and choose Rename from pop-up arrow menu.

Refresh library item list[1]

Use Refresh icon in Library panel.

Update library items on current page[1]

Modify figs/U2192.gif Library figs/U2192.gif Update Current Page.

Update library items sitewide[1]

Modify figs/U2192.gif Library figs/U2192.gif Update Pages.

Detach item instance from original library item[2]

Click Detach from Original button in the Property inspector.

Recreate library item [2]

Click the Recreate button in the Property inspector.

Copy library files between sites[2]

Choose Copy to Site from the pop-up arrow menu in the Library panel.

Find all files that use a library item

Choose Locate in Site from the pop-up arrow menu in the Library panel.

Change highlighted color of library items

Edit figs/U2192.gif Preferences figs/U2192.gif Highlighting figs/U2192.gif Library Items.

[1] Also available from the Library panel either from an icon or from the pop-up menu (see Figure 9-1).

[2] Available from the contextual menu using right-click (Windows) or Ctrl-click (Macintosh).

In the next chapter, you'll cover Dreamweaver's use of Cascading Style Sheets. Topics include associating a stylesheet with your document, using a stylesheet with a template, adding stylesheet objects to your elements, and creating external stylesheets.

    Previous Section Next Section