Embedding MGI TagsMGI also supports embedded tags. That is, you can use one MGI tag within the parameter value of another MGI tag or within the parameter value of an HTML tag. The embedded MGI tag replaces the entire value of the MGI or HTML parameter including the quotation marks: <mgiNameOfTag Parameter={mgiEmbeddedTag Parameter="Value"}> The syntax of embedded tags is: 1. Opening and Closing Braces
2. Tag Name
3. Parameters
Embedded tags are often functional and useful. For example, you might replace the "from" parameter of the mgiSendMail tag with a visitor's email address so that you can reply directly to the visitor after their form submission is converted to an email: <mgiSendMail mailserver="mail.domain.com" to="info@domain.com" from={mgiPostArgument name="Email" defaultValue="webmaster@domain.com"} subject="Info Request"> Information Request Text and MGI Tags </mgiSendMail> Embedding Multiple TagsOnly one MGI tag can be embedded within the parameter of another MGI tag. An extended embedded function can be achieved using variables. By first setting information in the value of a page or site variable, you can include any combination of text, tags and HTML in the value of a parameter. For example, you may want to include several components in the subject of an mgiSendMail tag. First set the information in the value of a page variable using the mgiSet tag: <mgiSet name="Email Subject"> <mgiFieldContent name="Product"><mgiFieldContent name="Style"> Request </mgiSet> Next, embed the value of the page variable in the subject parameter of the mgiSendMail tag using an mgiGet tag: <mgiSendMail mailserver="mail.domain.com" to="info@domain.com" from="webmaster@domain.com" subject={mgiGet name="Email Subject"}> Information Request Text </mgiSendMail> See the mgiSet and mgiGet tag descriptions for more information. Tags With BodiesA tag with a body cannot be embedded within another MGI tag or an HTML tag. To embed the value of a tag with a body in another MGI tag or an HTML tag, use the variable method described under Embedding Multiple Tags above. |