Chapter 18. 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 yourself frequently using more complex items, such as a pull-down menu listing all the countries your company ships products to, or a particular 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 encounter. Dreamweaver comes with hundreds of snippets organized into different folders, ...
Get Dreamweaver CS3: 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.