Reusing Content with Templates and Libraries > Creating, managing, and editing library items

 

Creating, managing, and editing library items

Libraries are a way to store page elements such as images, text, and other objects that you want to reuse or update frequently throughout your Web site. These elements are called library items.

When you place a library item in a document, Dreamweaver inserts a copy of the HTML source code for that item into the document, and adds an HTML comment containing a reference to the original, external item. The reference to the external library item makes it possible to update the content on an entire site all at once by changing the library item and then using the update commands in the Modify > Library submenu.

Dreamweaver stores library items in a Library folder within the local root folder for each site. Each site has its own library; to copy a library item from one site to another site, use the Assets panel's Copy to Site command. See Asset management overview for more information. Note that if the library item contains links, the links may not work in the new site. Also note that images in a library item aren't copied to the new site.

Here's an example of how you might use a library item: suppose you're building a large site for a company. The company has a slogan that it wants to appear on every page of the site, but the marketing department is still ironing out the details of just what the slogan should say. If you create a library item to contain the slogan and use that library item on every page, then when the marketing department provides the final slogan, you can change the library item and automatically update every page that uses it.