ColdFusion Studio Basics

I l @ ve RuBoard

ColdFusion Studio offers many built-in tools to aid in your development process. There are tools to help you with your already existing code and tools to help you with code you have yet to write. Some tools use wizards, while others just insert simple code such as font, bold, or italic tags. Some of them are to help write your database queries while others help you output them.

The quickbarthe menu in the upper-right portion of the screenoffers a large number of tools for working with both HTML and ColdFusion functions. Many of the tools in this quickbar will help you with manipulating already existing code.

One of these tools lets you change the HTML font size and styling. We'll use this one as an example to familiarize you with general process of using the built-in tools.

  1. Open helloworld.cfm from the previous lesson.

    You will be working with this file for the next few tasks . You can open it from the CD or your local hard drive.

  2. Highlight the text "Hello World!" with the mouse.

    Highlighting, or selecting, tells the editor what text you want to work with. Now when you use any of the tools, only this text will be affected.

  3. Click the Fonts tab in the quickbar.

    A number of options become available for dealing with fonts. You can change the size, typeface, color , or style of the text (italic, bold, subscript, or superscript).

  4. Select the Font icon from the fonts menu.

    The Font icon is the first icon on the left.

    This brings up the Tag Editor for fonts. From here you can make your selections to change the font size and color.

    NOTE

    Font sizes can be set in one of two ways. You can either set a specific number like size="1" or you can use a relative font size like size="2" . The base for using relative font sizes is 3 , so size="2" is the same as size="1".

    TIP

    You can also get to the Tag Editor for any tag by right-clicking the mouse while inside of the tag.

  5. Select the Color menu and drag it down until Blue is highlighted.

    By selecting blueor any other colorthe font tag that will be placed will have that color assigned to it when it is inserted.

  6. Select the HTML 4.0 tab within the Tag Editor.

    In this window you can choose the face for the font to go along with the color that you selected earlier. You can choose up to three individual faces, a predetermined combination, or a generic one.

  7. Select the Arial, Helvetica, Sans-serif option from the Combo field.

    You have now selected a face and a color for your font. The Arial, Helvetica, sans-serif option is one of the most common combinations on the Web today. It's very simple, and thus easy to read on the Web. Also, almost every personal computer has these fonts installed, so you don't have to worry about them not appearing properly.

    NOTE

    No matter how hard you work to make your fonts look nice and appear at just the right size, a user can control how fonts appear in their own browser, thus wrecking your beautiful style. Unfortunately there is nothing you can do about this.

  8. Click OK.

    Your new font tag will be applied to the text that you had highlighted earlier. However, since this font tag is within a <cfoutput> block, you will need to add an extra number sign (#) to the font color. Otherwise, ColdFusion will try to interpret this code as a variable. This is because all ColdFusion variables are surrounded by number signs (for example, if you had a variable called "name" it would be output as # name #). So when you use # in a <cfoutput> statement, be aware that ColdFusion is expecting a variable. To make it understand the situation, use two number signs (##) in a row so that ColdFusion will know you actually want to use a number sign.

TIP

There are several tools that don't require user input in a window to edit a tag; they just insert code. Sticking with the font example, the F+ icon on the Fonts tab in the quickbar increases the font size by one point each time it is clicked.


I l @ ve RuBoard


Macromedia ColdFusion 5. Training from the Source
Macromedia ColdFusion 5 Training from the Source (With CD-ROM)
ISBN: 0201758474
EAN: 2147483647
Year: 2002
Pages: 99
Authors: Kevin Schmidt

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