November 1999

HTML Improvements in FrontPage 2000

When it comes to HTML code, FrontPage has always tried to be helpful, automatically reformatting and fixing your HTML code when you leave HTML view. Oftentimes, however, the program fixes--or even breaks--things that aren't broken. For example, on some pages it generates, FrontPage 98 stubbornly moves the <title> tag below any meta tags, which can hurt your search engine listings.

To work around this problem, many users have resorted to editing their HTML code in text editors such as Notepad. With the introduction of FrontPage 2000, however, such workarounds are no longer necessary, as you'll see in this article.

Save our source code

FrontPage 2000 introduces a feature called HTML source preservation, which simply means the program leaves your HTML formatting alone. You can capitalize tags, add extra spaces, or insert line breaks within tags, and FrontPage won't fix them.

Look at Figure A, for example.

Figure A: Source preservation lets you format your HTML as you wish.
[ Figure A ]

We've capitalized all the HTML tags (and made parameters lower-case) to make them easier to spot. We've also added extra white space and indentations to make the structure of the document clearer. Notice how easy it is to spot where the code for the feedback form begins.

Other options

If you're a user who likes automatic formatting, don't worry; FrontPage 2000 still gives you that option. To turn automatic formatting on, choose Page Options from the Tools menu. In the Page Options dialog box that appears, click on the HTML Source tab to go to the property sheet shown in Figure B.

Figure B: FrontPage 2000 uses an extensive set of rules to control HTML formatting.
[ Figure B ]

Enable the Reformat Using The Rules Below option, and then click OK. When you switch to Normal or Preview mode, FrontPage reformats your code according to the rules shown in the Page Options dialog box.

As you may have guessed, FrontPage 2000's formatting rules are subject to change. Once you've enabled the Reformat Using The Rules Below option, you can change those rules to suit your own preferences.

In the center of the dialog box are several options that affect all the HTML on the current page. The Tag Names Are Lowercase, Attribute Names Are Lowercase, and Allow Line Breaks Within Tags check boxes in the formatting section are self-explanatory. The Indent text boxes let you specify how many spaces or tabs FrontPage will indent your code when you press [Tab]. The Right Margin text box specifies the width at which FrontPage will wrap code to the next line.

The remainder of the dialog box lets you control the formatting of specific HTML tags. When you select a tag from the scrolling list box on the left, the text boxes in the Line Breaks panel become available. Here, you can specify how many line breaks FrontPage should insert before and after both the start tag (<h1>, for example) and the end tag (</h1>).

You can also specify whether the contents of selected tags should be indented automatically. And, when certain tags are selected, you can specify whether the start tag or end tag may be omitted. (For example, the <p> tag doesn't have to be followed by a </p> tag.)

The Page Options dialog box includes two final options. Clicking the Base On Current Page button tells FrontPage to import the current page's settings into the dialog box. The Reset button restores FrontPage's default formatting rules.

Whatever changes you make in the Page Options dialog box will affect the current page as well as all future pages that you open. Therefore, once you've come up with settings you like, you won't have to make repeated trips back to the dialog box.

Copyright © 1999, ZD Inc. All rights reserved. ZD Journals and the ZD Journals logo are trademarks of ZD Inc. Reproduction in whole or in part in any form or medium without express written permission of ZD Inc. is prohibited. All other product names and logos are trademarks or registered trademarks of their respective owners.