O'Reilly logo

Dreamweaver MX 2004: The Missing Manual by David Sawyer McFarland

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 17. 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 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 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 might encounter. Dreamweaver comes with hundreds of snippets organized into different folders, like Comments ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required