CASE.EDU:    HOME | DIRECTORIES | SEARCH

The Web Development Blog has moved to http://www.heidicool.com/blog/. Please visit me there to read the latest entries and to update your bookmarks and RSS feeds.

August 31, 2005

Rediscovering Snippets

I recently did a new installation of Dreamweaver, and lost all of my customizations that I had accumulated. In hindsight, I guess there are quite a few that I can live without... but there was one group of indispensible time-savers that I found worthwhile to add back in. Veteran users of DW know these little tools as 'snippets'.

They are found in the Code panel. They are pieces of code that you can use over and over again. You access them by choosing 'Window' > 'Snippets... or by pressing the shortcut 'shift+F9'... or just click the snippets tab on the code panel.
Check them out if you haven't recently and you'll be surprized how helpful they can be. MacroMedia's Dreamweaver comes loaded with quite a few, (most of which I have to admit are NOT all that useful) but you'll soon find yourself creating little reusable code 'snippets' for yourself.
I'll make this entry short, since I've got a lot of snippets to (re)create for myself. Future entries in the WebDev Blog will cover installing your own snippets, for today though I'll leave you with one that I find useful. It is used in the creation of forms, and is the code that creates the '< select >' drop-down menus for States.
Maybe this is something that you won't use all the time, I needed it for a form I programmed in the last couple of days. Now, of course, you could just put a text field in for State: and ask (and expect) your user to enter two characters only, well, we all know how that'll turn out! In this case, if you use this snippet, values are programmed to be the two letter abbreviations, and on-screen labels are spelled out.
Whether or not you make this into your own snippet, I'll include it here for anyone to copy and paste into a reference file for yourself.
Here's what it looks like onscreen:

State:

Copy and paste. I hope you find this useful. I'll be back with another post with instructions for installing in DW's Code panel under 'snippets'.

StumbleUpon Toolbar Stumble It! AddThis Social Bookmark Button


Posted by: Kevin Adams August 31, 2005 04:53 PM | Category: Kevin's Stuff

Trackbacks

Trackback URL for this entry is: Rediscovering Snippets

Comments

gravatar

Thanks for posting this!

Posted by Pat on November 1, 2005 12:19 PM

gravatar

I don't use dreamweaver anymore as I have advanced to a level where I can just read the code and instantly know how it looks and will look like. When you get to that level you probably don't need dreamweaver anymore, since sometimes it doesn't show layouts correctly.
Snippets may be useful, but you can probably just search them on a search engine and find many more interesting ones.

Posted by execute Web Development on December 20, 2005 12:34 AM

gravatar

The way I handle Dreamweavers WYSIWYG inconsistencies is to just edit in code mode. When I first started using HTML I built my sites in plain text editors such as simple text or notepad. But even in code mode, I find Dreamweaver's color coding, find and replace and clean-up features can be quite useful.

Having a copy of Dreamweaver on your computer doesn't substitute for knowledge of HTML, XHTML, CSS, typography, design, marketing, etc., but it is a handy tool to have and works well for people on a fairly wide variety of skill levels. Your hint about finding snippets on the web is well taken. Additionally I find that when learning HTML it is helpful to see what other people are doing, and looking at their source code to see how they've achieved their goals.

Posted by Heidi Cool on January 27, 2006 05:04 PM

Post a comment

















Posted by: kla3 (Kevin Adams) August 31, 2005 04:53 PM | Comments (3) | Trackback