[TOC] [Prev] [Next] [Bottom]



Chapter Six

Using Meta Tags


Understanding Meta Tags and How to Insert Them

Meta tags are special tags that are entered in Tango Editor and are interpreted by Tango Server when your application files are executed. They can do many different things in an application file, from controlling the flow of information to performing an action on a data source to setting or retrieving variable values.

Meta tags look like HTML tags, with a starting and ending angle bracket ("<" and ">"), but the character after the starting angle bracket is "@", or in the case of a closing meta tag, "/@". When you are creating HTML in Tango Editor, you insert meta tags just like HTML tags. The user's Web browser never sees the meta tags, as they are interpreted by Tango Server before being sent to the Web browser.

You can find a complete and detailed list of Tango meta tags and their attributes in the Meta Tags and Configuration Variables manual.

This chapter covers the following topics:

  • introduction to meta tags
  • how to insert meta tags in Tango application files and HTML documents created with Tango.
[top] [back to top]


About Meta Tags

Meta tags are special commands to Tango that can do many things, including control execution of Tango application files, return values from a database, create variables, and return the values of variables. One of the places these tags have their effect is in the HTML returned by Tango Server to your Web browser; for example, Tango may return HTML to the browser using meta tags that refer to form field values (<@POSTARG>) and values returned from a database (<@COLUMN>).

Meta tags are interpreted by Tango Server at the application file execution time and the resulting values, if any, are substituted where the meta tags appear.

For detailed information on these and other meta tags, see the Meta Tags and Configuration Variables manual.

Most meta tags return values when interpreted by Tango Server. A few Tango meta tags that control the flow of information or assign values to variables do not return values. These include <@ROWS>, <@IF>, <@IFEQUAL>, <@IFEMPTY>, and <@ASSIGN> meta tags.

Meta tags begin with the "at" symbol, "@", to distinguish them from HTML tags. Closing meta tags begin with "/@". This documentation shows meta tags in uppercase, but meta tags are case insensitive; that is, <@if>, <@IF>, and <@iF> are all treated the same.

Meta tags often have attributes, much like HTML tags. These name/value attribute pairs specify required and optional attributes of the meta tag. For example:

<@ASSIGN NAME="last_name" VALUE="Flintstone">

This example assigns the value "Flintstone" to the variable last_name. You can leave the name of an attribute off in certain cases: if the attribute is required and in its standard position; however, it is recommended that you use attribute names to avoid ambiguity.

[top] [back to top]


Where You Can Use Meta Tags

Most meta tags can be used in all places in application files where text or HTML can be inserted, including these application file locations:

  • attribute HTML that is attached to an action, including:
  • Results HTML
  • Error HTML
  • No Results HTML
  • actions in an application file, including:
  • parameters in Search, Update, and Delete actions
  • column values in Update and Insert actions
  • Maximum Matches and Start Match fields in Search actions
  • External action parameters
  • File action parameters
  • Assign actions (both name and value)
  • If action parameters
  • custom and column references used in database actions
  • SQL entered into the Direct DBMS action window
  • HTML files included using the <@INCLUDE> meta tag
  • most attributes for other meta tags.

Where you can insert meta tags, the right mouse menu shows Insert Meta Tag.

[top] [back to top]


Combining Meta Tags

When you use meta tags in action fields or in attributes of other meta tags, you can use multiple meta tags and mix literal values with meta tags. For example, in a column value field parameter for an Insert action, you could specify:

<@POSTARG NAME=prefix><@POSTARG NAME=suffix>

This indicates the concatenation of the prefix and suffix form fields.

To give a long distance code in a standard format that includes spaces and meta tags, the parameter would look something like the following:

+1 <@POSTARG NAME=area_code> <@POSTARG NAME=phone_num>

[top] [back to top]


Quoting Attribute Values

Only attributes that have spaces in them need to be quoted, but it is never wrong to quote attributes. Either single or double quotes can be used.

For more information on the rules for quoting attributes in meta tags, see "Quoting Attributes" in the Meta Tags and Configuration Variables Manual.

For example:

<@CALC EXPR=3+4 PRECISION="2">
<@CALC EXPR="3+4" PRECISION="2">

Both examples are correct, as is the single quote

<@POSTARG NAME='homer'>.


!Tip: For new users of Tango, the best method to adopt is quoting all attribute values.


[top] [back to top]


Inserting Meta Tags

For more information, see "Working With Snippets".

Meta tags can always be entered by typing them or dragging a meta tag snippet into your application file. There is also a shortcut to inserting many common meta tags: the Insert Meta Tag dialog box. This dialog box does not contain all of the meta tags; some must be typed in or dragged in from the Snippets Workspace.

See the Meta Tags and Configuration Variables manual for a detailed list of meta tags and their options.

The Insert Meta Tag command, available from the context-sensitive right-mouse menu or the Edit menu, inserts a meta tag into an application file. This dialog box shows common meta tags in a category drop-down list. This provides a quick reference for many common meta tags.

To insert common meta tags into your application file
  1. From the Edit menu, choose Insert Meta Tag.

    The Insert Meta Tag dialog box appears.

  2. From the Category drop-down list, select one of the five options:
    • Form Field or URL Argument
    • Variable
    • Current Date/Time
    • Request Parameter
    • Action Result Item

    Selecting a category changes the dialog box to show the appropriate fields for the category of meta tag.

  3. Select or enter the attributes necessary for the meta tag you are inserting.
  4. Click Insert.

    The Insert button is enabled only when you have entered sufficient information to construct the meta tag.

    The meta tag and its attributes are placed at the insertion point in your application file when Insert is clicked. The various types of meta tags you can insert are described in the following sections.

Form Field or URL Argument

To insert a meta tag that returns the value of a form field or a URL argument, choose Form Field or URL Argument from the Category drop-down list. These meta tags are <@SEARCHARG>, <@POSTARG>, and <@ARG>. A name must be specified. (The name of an argument is assigned in the HTML form that is set up by the creator of a Web page.)

Once you have specified the name, the radio buttons have the following effects:

For more information, see "<@ARG>", "<@POSTARG>", and "<@SEARCHARG>" in theMeta Tags and Configuration Variables manual.

  • Single value has no effect on the inserted meta tag.
  • Array of values adds the TYPE=ARRAY parameter to the meta tag.

    Use this option to get all values for form fields which may contain multiple values (such as lists).

  • Either inserts <@ARG>.
  • Form field inserts <@POSTARG>.
  • URL argument inserts <@SEARCHARG>.
Variables

To insert a meta tag that returns the value of a variable (the <@VAR> tag) with the Insert Meta Tag dialog box, choose Variable from the Category drop-down list.

For more information, see "<@VAR>" in the Meta Tags and Configuration Variables manual.

The following attributes can be assigned for insertion of <@VAR> with the Insert Meta Tag dialog box:

  • Name contains an alphabetized list of variables assigned to (via Assign actions) in the current application file. Select one of the variable names or type one in. This attribute is required, and inserts the NAME attribute.

For more information, see "Understanding Scope".

  • The Scope drop-down list contains:
    • Default
    • Local
    • User
    • Cookie
    • Domain
    • System

    If the scope is other than default, the SCOPE=selectedScope attribute is added to the meta tag.

  • The Row and Column fields are enabled only when the Array element checkbox is checked. This option adds [rownumber, columnnumber] to the variable name. If you leave either of the Row or Column fields empty, the value defaults to "*", which means all rows or columns are returned.
Current Date/Time

To insert the current date or time using a meta tag, choose Current Date/Time from the Category drop-down list.

For more information see, "<@CURRENTDATE>, <@CURRENTTIME>, <@CURRENTTIME-
STAMP>" in the Meta Tags and Configuration Variables manual.

This action inserts <@CURRENTDATE>, <@CURRENTTIME>, or <@CURRENTTIMESTAMP>. There are various options you can set for Current Date/Time.

If you select a format other than Default, the FORMAT attribute is added to the tag.

The Format list contains several common formats of the type denoted by the Current date, Current time, or Current timestamp radio button. When the radio button selection changes, the Format selection reverts to Default.

Request Parameter

To return a value pertaining to the current user request, choose Request Parameter from the Category drop-down list.

For more information, see "<@CGIPARAM>" in the Meta Tags and Configuration Variables manual.

The Parameter list includes items corresponding to all of the <@CGIPARAM> tag parameters.

This action inserts <@CGIPARAM NAME=paramName>, where paramName is the CGI parameter name corresponding to the selected item in the list.

Action Result Item

To insert a meta tag that returns values from the first row of results for previously executed actions in the current application file execution, choose Action Result Item from the Category drop-down list.

For more information, see "<@ACTIONRESULT>" in the Meta Tags and Configuration Variables manual.

Action result items specified here are data from the first row of results generated by the action. A Search action, for example, may return 100 rows of data in ten columns. Specifying action result item six from that action (<@ACTIONRESULT searchActionName 6>) gives you the value from row one, column six.



[TOC] [Prev] [Next] [Bottom]



docs@pervasive.com

Copyright © 1998, Pervasive Software Inc. All rights reserved.