Library Basics

Imagine this situation: You manage a relatively large website consisting of thousands of web pages. At the bottom of each page is a simple copyright notice: “Copyright MyBigCompany. We reserve all rights—national, international, commercial, noncommercial, and mineral—to the content contained on these pages.”

Each time you add another page to the site, you could retype the copyright message, but this approach invites both typographic errors and carpal tunnel syndrome. And if you must format this text too, you’re in for even more work.

Fortunately, Dreamweaver’s Library can turn any selection in the document window (a paragraph, an image, a table) into a reusable chunk of HTML that you can easily drop into any Dreamweaver document. The Library, in other words, is a great place to store copyright notices, navigation bars, or any other chunks of HTML you use frequently.

So far, this description sounds pretty much like the snippets described in the previous section. But Library items have added power: When you add HTML to a web page using a Library item, that code remains linked to the original Library item, the one stored in Dreamweaver. Thanks to this link, whenever you update the original Library item, you get a chance to update every page that uses that item.

Suppose your company is bought, and the legal department orders you to change the copyright notice to “Copyright MyBigCompany, a subsidiary of aMuchBiggerCompany” on each of the website’s 10,000 pages. If you had ...

Get Dreamweaver CS5: The Missing Manual now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.