How to Create and Use Library Items in Dreamweaver
If you’re using Dreamweaver, it’s helpful to know how to for create a library item, add one to a page, and edit and update a library item across multiple pages. For these steps to work properly, you must do them in order. Before creating or using library items, you must first set up the site and open it in the Files panel.
How to create a library item in Dreamweaver
To create a library item that you can use on multiple pages on your site, follow these steps:
Open any existing file that has images, text, or other elements on the page that you want to save as a library item.
From this page, select an element or collection of elements that you want to save as a library item, such as the copyright information that appears at the bottom of the page.
Choose Modify→Library→Add Object to Library.
The Library Assets panel opens and displays any existing library items. Your new library item appears as Untitled.
Select Untitled and replace it by typing a new name as you would name any file in Explorer on a PC or the Finder on a Mac.
When you create a library item, Dreamweaver automatically saves it to the library. Naming library items makes them easier to identify when you want to use them. You can then easily apply library items to any new or existing page in your site.
How to add a library item to a page in Dreamweaver
You can easily add elements from the library to your pages by simply dragging them from the Assets panel to the page. When you add a library item, the content is inserted into the document and a connection is established.
This connection is important because it enables you to edit the library item later and apply the changes to all pages where the item appears, but it also means that you can’t edit the item on the page where it’s inserted.
To add a library item to a page, follow these steps:
Create a new document in Dreamweaver or open any existing file.
From the Files panel, click the Assets tab, and then click the Library icon.
The library opens in the Assets panel.
Drag an item from the library to the Document window.
Alternatively, you can select an item in the library and click the Insert button. The item automatically appears on the page. After you insert a library item on a page, you can use any of Dreamweaver's formatting features to position it on the page.
How to highlight library items in Dreamweaver
Library items are highlighted to distinguish them from other elements on a page. In the Preferences dialog box, you can customize the highlight color for library items as well as show or hide the highlight color. To change or hide library highlighting, follow these steps:
Choose Edit→Preferences (Windows) or Dreamweaver→Preferences (Mac).
The Preferences dialog box appears.
In the Category section on the left, select Highlighting.
Click the color box to select a color for library items and then select the Show box to display the library highlight color on your pages.
Leave the box blank if you don’t want to display the highlight color.
Click OK to close the Preferences dialog box.
How to make global changes in Dreamweaver with library items
The Dreamweaver library feature saves time because you can make changes to library items and automatically apply those changes to any or all pages where the library item appears. To edit a library item, follow these steps:
From the Files panel, click the Assets tab and then click the Library icon.
The library opens in the Assets panel.
Double-click any item listed in the library to open the item.
Dreamweaver opens a new window where you can edit the library item.
The library item won't have a <body> tag in which to specify background, link, or text colors. The library item acquires the right settings from the tags on the page where you insert it.
Change the library item as you would edit any element in Dreamweaver.
For example, you can change a link, edit the wording of text, change the font or size, and even add images, text, and other elements.
Choose File→Save to save changes to the original item.
The Update Library Items dialog box opens, displaying a list of all the pages where the library item appears.
To apply the changes you made to the library item on all listed pages, click the Update button.
If you don't want to apply the changes to all the pages where the library item appears, click the Don’t Update button.
If you clicked the Update button, the Update Pages dialog box appears and shows the progress of the updating. You can stop the update from this dialog box, if necessary.
How to edit one instance of a library item in Dreamweaver
If you want to alter a library item on a specific page or on a few pages, you can override the automated library feature by detaching it, or breaking the link between the original item in the library and the item inserted into the page.
After you break a connection, you can no longer update that page's library item automatically.
To detach an instance of a library item so that it can be edited independently, follow these steps:
Open any file that contains a library item and select the library item.
The Property inspector displays the library item options.
Click the Detach from Original button.
A warning message appears, letting you know that if you proceed with detaching the library item from the original, you can no longer update this occurrence of it when the original is edited.
Click OK to detach the library item.