Tag Chooser

Team-Fly    

Macromedia® DreamWeaver® MX Unleashed
By Matthew Pizzi, Zak Ruvalcaba
Table of Contents
Chapter E.  ColdFusion MX Tags and Beyond


The Tag Chooser is an invaluable guide to writing your own CFML. It helps you choose the correct CFML tag (there are more than 100 to choose from) and use the correct tag attributes.

Tag Chooser has most HTML and CFML tags built into it, tags for WML (Wireless Markup Language for WAP devices) plus other server technology tags such as ASP.NET and JSP. You can even add your own tags into the Tag Chooser library.

The Tag Chooser is used when writing your CFML pages. When you want to put in a tag that you may not know by heart or that you are not sure what the allowable attributes are, right-click (Control+click on the Mac) at the point you want the tag to be inserted. On the pop-up menu, choose Insert Tag, and as you can see in Figure E.4, the Tag Chooser appears.

Figure E.4. The Tag Chooser helps you code up your CFML tags correctly.

graphics/efig04.jpg

In Figure E.4 you can see that the left pane contains a list of the supported tag libraries each library is associated with a particular technology. Click the small plus sign next to the CFML Tags folder icon. The folder expands to show you subgroups of CFML tags, such as Database Manipulation, Security, and so on.

Choose a subgroup, and in the right pane, all the tags associated with that group are listed, as you can see in Figure E.5. Some tags may be in more than one subgroup. Choose a tag, and if you want to find out what it does and how to use it, read the tag info pane underneath. If you cannot see a tag info pane, click the button marked Tag Info. This pane gives you information about the tag. Clicking the <?> button next to it makes the information appear in the Reference window of the Code Panel; it's the same information, but appears in a different place. If it seems that the tag is what you want, click the Insert button.

Figure E.5. The Tag Chooser groups tags by functionality and shows you information about the tag.

graphics/efig05.jpg

If the tag does not need any attributes (such as <cfbreak> to break out of a loop), it will be inserted, but the Tag Chooser will not close.

If the tag either requires or has optional attributes (such as <cfquery> to query a database), a dialog box will pop up, enabling you to enter the attribute values, as you can see in Figure E.6, which shows the Edit Attributes dialog box for a <cfoutput> tag.

Figure E.6. The Tag Chooser also enables you to easily enter tag attributes, if required.

graphics/efig06.jpg

After clicking OK, the tag is inserted, but the Tag Chooser does not disappear. This means that tags are sometimes put into the page behind the Tag Chooser window, without your realizing it. By the time you click the Close button to close the Tag Chooser, you find you have inserted 15 <cfif> tags!

WARNING

You can also insert tags by double-clicking the tag name. You may well do this by accident and not notice the tags being inserted behind the Tag Chooser window.


Editing Tags

Using the Tag Chooser, you can also edit tags that are already in your code. Right-click (Control+click on the Mac) inside a tag on your page and choose Edit Tag from the pop-up menu.

The Edit Attributes window from the Tag Chooser will appear, as shown in Figure E.7, enabling you to modify the attributes and therefore the behavior of the tag. Clicking OK updates the tag on the page.

Figure E.7. Here we are editing a <cfquery> tag, modifying its attributes.

graphics/efig07.jpg

Insert Panels

Yet another way to use the Tag Chooser is from the Insert panel group. This panel of toolbars, usually located at the top of the screen, will have slightly different panels depending on the server technology you are using. For ColdFusion, you get three extra panels; CFML Basic, CFML Flow, and CFML Advanced.

The CFML Basic panel, shown in Figure E.8, gives you buttons to insert common CFML tags for basic Web application design. As you move the mouse over each button, you see the tag that the button will insert. The CFML Flow panel lets you control program flow with tags such as <cfif> and <cfelse> and allows you to insert tags for error handling routines. The CFML Advanced panel gives you buttons to use ColdFusion utilities such as sending email and drawing charts.

Figure E.8. The CFML Basic panel on the Insert bar. This gives buttons for inserting common CFML tags.

graphics/efig08.jpg

Clicking any of these buttons displays the Tag Chooser, open at the selected tag.


    Team-Fly    
    Top


    Macromedia Dreamweaver MX Unleashed
    Macromedia Dreamweaver MX 2004 Unleashed
    ISBN: 0672326310
    EAN: 2147483647
    Year: 2002
    Pages: 321

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