The mgiSet Tag

Tag Behavior

The mgiSet tag is used to set a variable with a specified scope and value.


Tag Syntax

The mgiSet tag has a beginning tag with one required parameter and 3 optional parameters, a body, and an ending tag. The tag form is:

<mgiSet name="Name" scope="Page/Site" type="Variable Type" 
defaultValue="Value">
Variable Value
</mgiSet>

Required Parameters:

  • name="Name" where "Name" is the unique name of the variable to be set.

Optional Parameters:

  • scope="Page" or "Site" where "Page" indicates that the variable is only available for the page on which the mgiSet tag resides and "Site" indicates that the variable is globally available for any page or level of the web site. Site variables are stored in an MGI database. The default scope is "Page".
  • type="Variable Type" where "Variable Type" is the type of variable that is set. Valid types include "Number" (stores integer and decimal numbers), "Boolean" (stores true and false values), and 'Text" (stores alpha-numeric characters). The default value is "Text". Page variables are always set as "Text", but are converted to "Number" when used in numerical comparisons.
  • defaultValue="Value" where "Value" is the text that will be set if the tag body is blank.

Tag Body:

  • The body of the mgiSet tag is the value of the variable.


Example Usage and Output

<mgiSet name="Color" scope="Page">
<mgiFieldContent name="color">
</mgiSet>

In this example, the color of an item is set as a page variable. Further down the page, the value of the variable (the item color) is used in an mgiIf comparison to display the price of the item based on the chosen color.


Suggested Usage

  • Variables


[Return to the Referencing MGI Menu]


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