Using MGI Tags

The proper format of an MGI tag is:

<mgiNameOfTag RequiredParameter="value of parameter" 
OptionalParameter1="value" OptionalParameter2="value">

Spacing

Note that there is no space between the name of the tag and the opening character and that there is also no space before the closing character (which may occur directly after the tag name or occur after the last parameter, depending on the tag). There is one space between the name of the tag and the first parameter and one space between each parameter. Do not string different parameters together. Do not use tabs. Do not use periods. Keep it simple -- just use single spaces. Within the value of a parameter (enclosed in quotation marks), you may use spaces. For example, there are spaces in the name parameter of this mgiButton tag:

<mgiButton name="Submit Order">

Parameter Format

Each parameter has a specific syntax. A parameter begins with the name of the parameter, followed by an equal (=) sign, followed by the value of the specific parameter within quotation marks. The use of the word "value" in the examples above is just an example and does not indicate an actual option for each parameter. A list of options for all parameters (required and optional) are included in the tutorial for each tag.

Some MGI tags have no required or optional parameters at all. In those cases, all you need is the name of the tag itself enclosed within opening (<) and closing (>) characters. Other tags may have more than one required parameter. In that case, just separate each parameter with a single space. Some tags will have many optional parameters. Again, just separate each parameter that you want to include with a single space.

Required and optional parameters can also be written in any order. The only thing that has to be specifically placed is the actual name of the MGI tag -- it must go first, immediately following the opening character of the tag.

Case-Sensitivity

MGI tags and parameter names are case insensitive -- we use both upper- and lower-case letters in this guide to make the tags easier to read. However, the value of some parameters (especially the field names used in the database tags) are case-sensitive, so it is advisable to use consistent capitalization.

Coding MGI Tags in HTML Files

MGI tags (like other HTML tags) should be coded using a text editor with raw HTML text files. Even if you use a graphic HTML editor to create web site pages, you should use the raw HTML option or a separate text editor to add MGI tags. For example, MGI tags should be coded in the "HTML Source" view of PageMill and surrounded by NoEdit tags to insure that PageMill does not make automatic corrections or changes to the tags:

<!--NOEDIT--><mgicounter name="homepage"><!--/NOEDIT-->

If MGI tags are added in the graphic view of an HTML editor, the opening and closing tag characters and the quotations marks are often converted from text to HTML character entities (e.g. "&quot;" represents a quotation mark in HTML). MGI cannot be parsed correctly if the tag components are converted to such character entities.


[Processing Tags] [Default Home Pages] [Errors] [MGI Data Folder] [Writing Tags] [Using Tags] [Embedding Tags]


[User Guide Main Menu] [Understanding MGI Menu] [Using MGI Menu] [Referencing MGI Menu]