O'Reilly logo

Dreamweaver CS5.5: 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 20. Snippets and Libraries

You’ve finished the design for your company’s new website. It looks great and your boss is ecstatic. But you’ve really only just begun. You have to build hundreds of pages before you launch the site. And once the site’s online, you’ll need to make endless updates to keep it fresh and inviting.

This is where Dreamweaver’s Snippets and Library features come in, streamlining the sometimes tedious work of building and updating web pages.

As you create more and more web pages (and more and more websites), you may find yourself crafting the same web page elements over and over again. Many of your pages may share common elements that always stay the same: a copyright notice, a navigation bar, or a logo, for example. And you may find yourself frequently using more complex components, such as a pull-down menu that lists all the countries you ship products to, or a particular design 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 you store away and then plunk into your web pages as necessary. The can be as simple as boilerplate legal text, or as complex as HTML, CSS, or JavaScript code (or code from any other programming language you encounter). For example, say ...

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