Writing MGI Tags
MGI incorporates powerful back-end processing with simple HTML-style tags. No matter how complex those back-end processes are, the tags stay simple and easy to use. To facilitate ease of use, there is a common syntax for all MGI tags.
MGI Tag Syntax
Each MGI tag has three distinct components:
1. Opening and Closing Characters:
2. Tag Name:
Some MGI tags consist of two tags, a beginning tag and an ending tag. A beginning tag follows the syntax described above with required and optional parameters. An ending tag always consists of an opening character, a forward slash (/), the name of the MGI beginning tag, and the closing character. The space between a beginning and ending tag is known as the body and can usually consist of text , HTML and/or other MGI tags. For example, this mgiSendMail tag includes a beginning tag with three required parameters, an optional parameter, a body, and an ending tag. In the following example, text and mgiPostArgument tags are included in the body of the mgiSendMail tag.
<mgiSendMail to="firstname.lastname@example.org" from="email@example.com" subject="Info Request" mailserver="mail.domain.com"> Info Request ************ Name: <mgiPostArgument name="Name"> Address: <mgiPostArgument name="Street Address"> City: <mgiPostArgument name="City"> State: <mgiPostArgument name="State"> Zip: <mgiPostArgument name="Zip Code"> Phone: <mgiPostArgument name="Phone"> Email: <mgiPostArgument name="Email Address"> Comments: <mgiPostArgument name="Comments"> </mgiSendMail>