The mgiCounter Tag

Tag Behavior

The mgiCounter tag increments and displays a text or graphic counter. Counter values are stored in an MGI database.


Tag Syntax

The mgiCounter tag has one required parameter and eight optional parameters. The tag form is:

<mgiCounter name="Name" type="Text/Graphic" length="Whole Number"
increment="Yes/No" display="Yes/No" font="Font Name" 
fontFolderLocation="Folder Path" setCount="Whole Number"
ignoreClientIpAddress="Yes/No">

Required Parameters:

  • name="Name" where "Name" is the unique, alpha-numeric identification of the counter. Note: counter names are case-sensitive.

Optional Parameters:

  • type="Text" or "Graphic" where "Text" indicates that the counter is displayed as regular HTML text characters and where "Graphic" indicates that the counter is displayed as gif images in a specified font. The default is "Text". If the type is set to "Graphic", then either the "font" or "fontFolderLocation" parameter must also be included.
  • length="Whole Number" where "Whole Number" is the number of characters between 1 and 9 that the counter should display. If the length parameter is not included, the default behavior of the mgiCounter tag is to display the total number of characters of the counter value (e.g., a counter value of 204 requires the display of 3 characters).
  • increment="Yes" or "No" where "Yes" indicates that the counter should increment when a page is accessed and where "No" indicates that the counter should not increment when a page is accessed. The default is "Yes".
  • display="Yes" or "No" where "Yes" indicates that the counter should display on a page and where "No" indicates that a counter should not display on a page.
  • font="Font Name" where "Font Name" is the full name of the graphic font included with the mgiCounter tag. To use the "font" parameter, you must set the "type" parameter to "Graphic". The default font is "GreyScaleOdometer". See the list below for additional font names and displays.
  • fontFolderLocation="Folder Path" where "Folder Path" is the relative path to the folder containing custom graphic counter images. Custom graphic counter images must be saved in gif format and named with the following syntax:
    • zero.gif
    • one.gif
    • two.gif
    • three.gif
    • four.gif
    • five.gif
    • six.gif
    • seven.gif
    • eight.gif
    • nine.gif
  • setCount="Whole Number" where "Whole Number" is the value the counter will be set to when the page is accessed. When the setCount parameter of mgiCounter is present, all other parameters and behaviors of the counter are ignored.
  • ignoreClientIPAddress="Yes" or "No" where "Yes" indicates that the counter increments for any IP number and "No" indicates that the counter only increments if the IP number of the current visitor does not match the IP number of the previous visitor. The default is "Yes". This parameter can be used to create more accurate counts.

Included Font Names and Displays:

Font Name Font Display
 GreyScaleOdometer

 DigitBlueGlow

 Greeny

 RedDigital

 SmallBlue

 SaintFrancis


Example Usage and Output

<mgiCounter name="index" type="Text" length="4" 
increment="Yes" display="Yes">

In this example, the mgiCounter will display as regular text with a padding of 4 characters and increment every time the page is accessed. If the previous value of the counter was 257, then the counter will display the following when the page is next accessed by any web site visitor:

0258

<mgicounter name="about" type="Graphic" increment="Yes" 
display="Yes" font="SaintFrancis" ignoreClientIpAddress="No">

In this example, the mgiCounter will display the "SaintFrancis" font and increment every time a unique IP number accesses the page. If the previous value of the counter was 300234, then the counter will display the following when the page is accessed by a different web site visitor:


Suggested Usage

  • Counters


[Return to the Referencing MGI Menu]


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