Index  Previous: TITLE   Next: TAGS

DESCRIPTION

There are dozens of MML pre-defined tag functions. If you don't see just what you need, you can use USER DEFINED TAGS to create tags just as powerful as the pre-defined ones.

There are two styles of supplying parameters to a tag -- named and positional. In addition, you can usually embed MiniVend tags within HTML tags.

In the named style you supply a parameter/value pair just as most HTML tags use:

    [value name="foo"]

The same thing can be accomplished for the [value] tag with

    [value foo]

The parameter name is the first positional parameter for the [value] tag. Some people find positional usage simpler for common tags, and MiniVend interprets them somewhat faster. If you wish to avoid ambiguity you can always use named calling.

In most cases, tags specified in the positional fashion will work the same as named parameters. The only time you will need to modify them is when there is some ambiguity as to which parameter is which (usually due to whitespace), or when you need to use the output of a tag as the attribute parameter for another tag.

TIP: This will not work:

    [page scan se=[scratch somevar]]

To get the output of the [scratch somevar] interpreted, you must place it within a named and quoted attribute:

    [page href=scan arg="se=[scratch somevar]"]

MiniVend tags can be specified within HTML to make it easier to interface to some HTML editors. Consider:

    <TABLE MV="if items">
    <TR MV="item-list">
    <TD> [item-code] </TD>
    <TD> [item-description] </TD>
    <TD> [item-price] </TD>
    </TR></TABLE>

The above will loop over any items in the shopping cart, displaying their part number, description, and price, but only IF there are items in the cart.

The same thing can be achieved with:

    [if items]
    <TABLE>
    [item-list]
    <TR>
    <TD> [item-code] </TD>
    <TD> [item-description] </TD>
    <TD> [item-price] </TD>
    </TR>
    [/item-list]</TABLE>
    [/if]

What is done with the results of the tag depends on whether it is a container or standalone tag. A container tag is one which has an end tag, i.e. [tag] stuff [/tag]. A standalone tag has no end tag, as in [area href=somepage]. (Note that [page ...] and [order ..] are not container tags.)

A container tag will have its output re-parsed for more MiniVend tags by default. If you wish to inhibit this behavior, you must explicitly set the attribute reparse to 0. Note that you will almost always wish the default action. The only container MML tag that doesn't have reparse set by default is [mvasp].

With some exceptions ([include] is among them) among them) the output of a standalone tag will not be re-interpreted for MiniVend tag constructs. All tags accept the INTERPOLATE=1 tag modifier, which causes the interpretation to take place. It is frequent that you will not want to interpret the contents of a [set variable] TAGS [/set] pair, as that might contain tags which should only be upon evaluating an order profile, search profile, or mv_click operation. If you wish to perform the evaluation at the time a variable is set, you would use [set name=variable interpolate=1] TAGS [/set].




Index  Previous: TITLE   Next: TAGS