Code Formatting Options

The Code Formatting tab of the Page Options dialog (shown in Figure 26.4) gives you extensive control over how code is formatted in Code view.

Figure 26.4. Control over how code is formatted is specified in the Code Formatting tab of the Page Options dialog.

graphics/26fig04.jpg

graphics/troubleshooting_icon.jpg

If you make a change to formatting and it doesn't take effect, see "Formatting Changes Don't Take Effect" in the "Troubleshooting" section of this chapter.


The Code Formatting tab allows you to configure the following settings:

  • Tag names are lowercase If checked, HTML tags are added in lowercase. Also causes HTML tags appearing in IntelliSense to appear in lowercase.

  • Attribute names are lowercase If checked, tag attributes are added in lowercase. Also causes attributes appearing in IntelliSense to appear in lowercase.

  • Allow line breaks within tags If checked, line breaks are added inside HTML tags once the tag length reaches the number of characters specified in the Right margin box.

  • Tab size The number of spaces represented by a press of the Tab key. The size of a single space depends on the font selected on the Default Fonts tab.

  • Indent # tabs/spaces The number of characters inserted when code is indented. The dropdown determines whether the characters inserted are spaces or tabs.

  • Right margin The number of characters before a line break is inserted. If Allow line breaks within tags is not checked, FrontPage will not insert a line break within a tag even if the right margin has been reached.

  • Insert tabs as spaces If checked, will insert spaces instead of tabs when indenting code. The number of spaces inserted per tab is indicated by the value entered in the Tab size box.

  • Tags Allows for configuration of specific HTML tags. By selecting a specific tag from the list, you can modify settings specific to that tag.

  • Base on current page Clicking this button will set code formatting options based on the page currently active.

  • Reset Resets all code formatting options to their defaults.

NOTE

Changes made in the Code Formatting tab apply only to the appearance of code in FrontPage's Code view. They do not affect the appearance of the page when viewed in a browser.


graphics/troubleshooting_icon.jpg

If you notice lines breaking before reaching the specified right margin setting, see "Lines Breaking Too Soon" in the "Troubleshooting" section at the end of this chapter.


By selecting a specific HTML tag in the Tag list, you can configure the following settings, which apply only to that tag:

  • Line breaks before start The number of line breaks inserted before the start tag.

  • Line breaks before end The number of line breaks inserted before the end tag.

  • Line breaks after start The number of line breaks inserted after the start tag.

  • Line breaks after end The number of line breaks inserted after the end tag.

  • Omit start tag If checked, the start tag for the selected tag is omitted.

  • Omit end tag If checked, the end tag for the selected tag is omitted.

  • Indent contents If checked, tags that are enclosed within the selected tag are indented.

The Omit Start Tag, Omit End Tag, and Indent Contents check boxes are enabled and disabled based on the tag that is currently selected. For example, because the <form> tag requires both start and end tags, the Omit Start Tag and the Omit End Tag check boxes are disabled. Likewise, when tags that cannot contain child tags are selected (such as the <br> tag), the Indent Contents check box is disabled.

TIP

Many ASP developers have a need to create pages that have no <html> or <body> tags. By selecting each one of these tags and checking the Omit Start Tag and the Omit End Tag check boxes, FrontPage will allow you to create pages without <html> and <body> tags.


FrontPage 2003 also provides options for code display on the General tab of the Page Options dialog, as shown in Figure 26.5.

Figure 26.5. The General tab provides basic display options for the Code view.

graphics/26fig05.jpg

The following Code view options are available:

  • Word wrap Forces lines to wrap at the right edge of the document window.

  • Auto indent Automatically indents lines of code as necessary to line them up with previous lines.

  • Line numbers Displays lines numbers in the left side of the document window. Note that enabling line numbers will automatically also show the Selection margin even if the Selection Margin box is not checked.

  • Selection margin Displays a shaded left margin for quick selection of lines of code. Clicking inside this margin on a particular line selects that line of code. Dragging the mouse down multiple lines selects multiple lines of code.



Special Edition Using Microsoft Office FrontPage 2003
Special Edition Using Microsoft Office FrontPage 2003
ISBN: 0789729547
EAN: 2147483647
Year: 2003
Pages: 443

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net