Working with Code Snippets

A code snippet is a short batch of code (HTML or script) or text that you can define and reuse many times with an easy keyboard shortcut. FrontPage has several predefined code snippets, but it also offers you the ability to build and edit your own.

To make the use of code snippets even easier, you can associate a keyword to the code snippet, letting you select and enter the snippet even quicker.

NOTE

Code Snippets are stored on the system they were entered or modified on. A code snippet library can't be transferred to another site or system.


Using Code Snippets

To use the Code Snippet tool, you must be in either Code view or the coding area of Design view. To open the Code Snippet box, press Ctrl+Enter. As shown in Figure 28.1, the Code Snippets box will open, allowing you to scroll through and pick the snippet of your choice. You can scroll through the choices with the arrow keys or your mouse. You can also enter the first letters of your keyword, and the list will jump to the desired location. Press Enter (or double-click) to select a snippet.

Figure 28.1. With the Code Snippet interface used in Code view, you can scroll through your choices and select with the Enter key.

graphics/28fig01.gif

Adding, Modifying, and Deleting Code Snippets

The first option in the Code Snippet interface (seen in Figure 28.1) is the Customize List option. Selecting this option will open the Code Snippets tab in the Page Options dialog box, as seen in Figure 28.2. You can also access the Page Options dialog box by selecting Tools, Page Options.

Figure 28.2. Code snippets can be added to, modified, or removed from your system.

graphics/28fig02.gif

The Add and Modify buttons offer the same interface as shown in Figure 28.3. The three options allow you to enter a keyword for the snippet, a description of the snippet, and the snippet content. There is no limit to the size of the snippet.

Figure 28.3. There is no limit to the size of the snippet that you can create.

graphics/28fig03.jpg

NOTE

Any code entered by hand into a code snippet is not validated by FrontPage. Double check that your code is good before you make it a snippet.


To delete a snippet from the list, click the Remove button.

NOTE

When you click the Remove button on the Page Options dialog box, there is no verification of your choice and there is no way to undo the delete.


graphics/troubleshooting_icon.jpg

If you are having problems finding your code snippets, see "Where Did My Snippets Go" in the "Troubleshooting" section at the end of this chapter.


TIP

Make use of the free SnipView add-in that comes with the CD with this book. It manages your snippets for you and lets you back them up and move them around from computer to computer as needed. This product is exclusive to this book and can't be purchased online at any price.




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