• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 4. Editing Code > Hand Coding in Dreamweaver

Hand Coding in Dreamweaver

Dreamweaver serves as a full-fledged code editor for all sorts of files: HTML, CSS, XML, XTML, JSP, ASP, ASP.NET, and so on.

When you type code in Dreamweaver, two features track what you type and make suggestions: Tag completion (similar to the autocomplete feature in programs such as Eudora and Microsoft Word); and Tag hints, a contextual menu that offers choices for tags and attributes based on what you type.

Tag completion

On a blank page or test page, open Code view or the Code inspector and type a left angle bracket: <

The Tag Hints menu will appear (Figure 4.53), listing pretty much every dadblasted tag there is. You can select a tag from the menu, but it might be more expedient to keep typing the letter P:

<p

Figure 4.53. Type an opening angle bracket, or less-than sign, and the Tag Hints menu will appear.


The menu will scroll to the P listings, where your choices are P, PARAM, and PRE (Figure 4.54).

Figure 4.54. I typed the letter p inside the bracket, and the menu scrolled to the p's.


Click the name of a tag and press Enter (Return) to insert it into the code, if you wish, or finish typing the tag by hand:

<p>

Dreamweaver will automatically close your tag:

<p></p> (Figure 4.55)

Figure 4.55. I finished typing the <p> tag and Dreamweaver supplied the closing </p> tag.

Now, when I hand code, I prefer to type my content and then close the tag, but here Dreamweaver is performing a public service by making sure that tag gets closed. If you start typing now, your content will appear between the <p></p> tags, as in <p>my text</p>.

Turning off autocomplete

Is this autocomplete stuff bothering you? Some hand coders would prefer not to see any fancy extra features, and I find them distracting on occasion. You can choose whether or when to show the Tag Hints menus, and whether you want tags completed and closed for you.

To change tag completion preferences

1.
Open the Preferences dialog box (Edit > Preferences; on Mac OS X, choose Dreamweaver > Preferences).

2.
Select Code Hints from the Category list to display the relevant options.

3.
Deselect the Enable Auto Tag Completion checkbox if you don't want Dreamweaver closing your tags for you (Figure 4.56). You can turn this option back on whenever you want.

Figure 4.56. Deselect the Enable Auto Tag Completion checkbox if you don't want closing tags to be supplied for you.


4.
You can also choose which Hints menus, if any, you want to pop up when you're typing code. (You can choose any of the attributes shown in Figure 4.60. For more about the Hints menus, see the next section.)

Figure 4.60. You can add delay time before the menu appears and choose which menus to use in the Code Hints panel of the Preferences dialog box.


5.
To save your preferences, click on OK. These changes will take effect immediately.

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint