Section 16.1. Snippets Basics

16.1. 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, like Footers (canned footer designs), Form Elements (useful form parts like pull-down menus ), and JavaScript code (programming code for interesting effects like adding a random image to a page).

For example, say you always use the same table design to create a sidebar on a page. Each time you want to create a similar table, you could go through all the same steps to build itor you could turn that table into a snippet and then, with a simple double-click, add it to page after page of your site.

You keep these code chunks in the Snippets tab of the Files panel (see Figure 16-1). You get to them in any of several ways:

  • Choose Window Snippets.

  • Windows people can press Shift-F9. (There's no Mac keyboard shortcut for opening the Snippets tab, but you can create your own if you want, as described on Section 19.1).

  • Click the Snippets tab on the Files panel.

Above and beyond Dreamweaver's preinstalled snippets, you can quickly build a collection of your own.


Note: Dreamweaver MX 2004 users : Note that the Snippets panel has moved. It's now grouped with the Files and Assets panels.


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