Section 16.5. Library Basics

16.5. Library Basics

Imagine this situation: You manage a relatively large Web site consisting of thousands of Web pages. At the bottom of each page is a simple copyright notice: "Copyright MyBigCompany. We reserve all rightsnational, international, commercial, noncommercial, and mineralto 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, then you're in for quite a bit of 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.

But this is only half of the Library's power. Each Library item that you add to a Web page is actually only a copy, which remains linked to the original. 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, for example, and the legal department orders you to change the copyright notice to "Copyright MyBigCompany, a subsidiary of aMuchBiggerCompany" on each of the Web site's 10,000 pages . If you had cleverly inserted the original copyright notice as a Library item, you could take care of this task in the blink of an eye. Just open the item in the Library, make the required changes, save it, and let Dreamweaver update all the pages for you (see Figure 16-3).

Compared to Snippets, Library items are much smarter . They possess the unique ability to update the same material on an entire site's worth of files in seconds, and can successfully deal with links and images. Unlike Snippets, however, Dreamweaver's Library feature is site-specific. In other words, each site that you've defined in Dreamweaver has its own Library. You can't use a Library item from one site on a page from a different site.

Figure 16-3. The Museum of Modern Art's home page, which was created with Dreamweaver, takes advantage of Library elements. Many of the navigation options on the page (circled) are Library items. If the Museum decides to add or remove a navigation link, it can update the Library item to change every page on the site in one simple step (see Section 16.7). In fact, since a Library item is a chunk of HTML, the Museum could decide to replace the left-hand navigation bar with a Flash movie, plain-text links (instead of graphics), or any other valid HTML code.



Dreamweaver 8[c] The Missing Manual
Dreamweaver 8[c] The Missing Manual
ISBN: 596100566
EAN: N/A
Year: 2006
Pages: 233

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net