Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Chapter 16 chapter 16 Snippets and Libraries You've finished the design for your company's new Web site. It looks great and your boss is ecstatic. But you've really only just begun. There are hundreds of pages to build before you launch. And once the site's online, you'll need to make endless updates to keep it fresh and inviting. This is where Dreamweaver's Snippet and Library features come in, streamlining the sometimes tedious work of building and updating Web pages. As you build more and more Web pages (and more and more Web sites), you may find yourself creating the same Web page elements over and over again. Many pages of a site may share certain common elements that are always the same: a copyright notice, a navigation bar, or a logo, for example. And you may find your- self frequently using more complex items, such as a pull-down menu listing the twelve months of the year, or a particular table design you use for photos and their captions. Recreating the same page elements time after time is tiresome and--thanks to Dreamweaver--unnecessary. Dreamweaver provides two subtly different tools for reusing common page elements: Snippets and Library items. Snippets Basics Snippets aren't fancy or complex, but they sure save time. A snippet is simply a chunk of code that you store away and then plunk into other Web pages. It could be HTML, JavaScript, or any of the other programming languages you may 573 Dreamweaver 8: The Missing Manual, eMatter Edition Copyright © 2008 O'Reilly & Associates, Inc. All rights reserved.