The mgiLoop TagTag BehaviorThe mgiLoop tag repeats an action or display for a specified range of numbers or a specified list of values. Tag SyntaxThe mgiLoop tag has a beginning tag with one required parameter and one optional parameter, a body, and an ending tag. In addition, the mgiLoop tag has required and optional parameters for specific modes. The tag form is: <mgiLoop mode="Mode" indexName="Set Name"> &mgiLoopIndexIndexName; </mgiLoop> Required Parameters:
Optional Parameters:
Counting Mode Required Parameters:
Counting Mode Optional Parameters:
List Mode Required Parameters:
red, orange, yellow, green, blue, violet The Loop Index Marker:
&mgiLoopIndexColors; Example Usage and OutputExample Counting Mode Usage and Output <mgiLoop mode="Counting" first="1" last="10" step="2"> &mgiLoopIndex; <BR> </mgiLoop> In this example, every other number (beginning with the first number) between 1 and 10 is displayed on a seaprate line as follows. If values are not separated by an HTML tag such as a header tag, paragraph tag or break tag then they are displayed continuously on one line.
Example List Mode Usage and Output <mgiLoop mode="List" itemList="Red,Orange,Yellow,Green,Blue" listDelimiter="," indexName="Colors"> <P>&mgiLoopIndexColors; is a color in the rainbow.</P> </mgiLoop> In this example, each item in the set of colors is placed in the sentence "Value is a color in the rainbow." and displayed as follows. If values are not separated by an HTML tag such as a header tag, paragraph tag or break tag then they are displayed continuously on one line.
Example Nested mgiLoop Tags Usage and Output <mgiLoop mode="Counting" first="1" last="3" indexName="Numbers"> <P>&mgiLoopIndexNumbers;. <UL> <mgiLoop mode="List" itemList="A,B,C" listDelimiter="," indexName="Letters"> <LI>&mgiLoopIndexLetters; </mgiLoop> </UL> </mgiLoop> When you nest mgiLoop tags, you must use the "indexName" parameter and include the indexName parameter value in the loop index marker (otherwise the index loop marker may not display the values from the appropriate itemlist). In this example, an outline is created nesting a loop of the letters A, B and C in a bullet list inside a loop that counts from 1 to 3. The outline would appear as:
Suggested Usage
|
[Return to the Referencing MGI Menu]
[User Guide Main Menu] [Understanding MGI Menu] [Using MGI Menu] [Referencing MGI Menu]