Using Meta TagsUnderstanding Meta Tags and How to Insert ThemMeta 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:
About Meta TagsMeta 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 if the attribute is required and in its standard position; however, it is recommended that you use attribute names to avoid ambiguity. Where You Can Use Meta TagsMost meta tags can be used in all places in Tango application files and Tango class files where text or HTML can be inserted, including these locations:
Where you can insert meta tags, the contextual menu shows Insert Meta Tag. Combining Meta TagsWhen 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 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> Quoting Attribute ValuesOnly 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. |
<@CALC EXPR=3+4 PRECISION="2">
Both examples are correct, as is the single quote
Inserting Meta Tags |
Meta tags can always be entered by typing them or dragging a meta tag snippet into your Tango application file or Tango class 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 Edit menu or the contextual menu, inserts a meta tag into a Tango application file or Tango class file. This dialog box shows common meta tags in a category pop-up menu. This provides a quick reference for many common meta tags. To insert common meta tags into your Tango application file or Tango class file
Form Field or URL ArgumentTo 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 pop-up menu. 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 the Meta Tags and Configuration Variables manual. |
VariablesTo 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 pop-up menu. |
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: |
Current Date or TimeTo insert the current date or time using a meta tag, choose Current Date or Time from the Category pop-up menu. |
|
For more information, see on <@CURRENT DATE>, <@CURRENT TIME>, <@CURRENT TIMESTAMP> 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 or 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 ParameterTo return a value pertaining to the current user request, choose Request Parameter from the Category pop-up menu. |
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 ItemTo 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 pop-up menu. |
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. |
Copyright © 1999, Pervasive Software. All rights reserved.