code: 02.
section: DESCRIPTION
type: item
title: Looping tags and Sub-tags

<A NAME="Looping_tags_and_Sub_tags">Looping tags and Sub-tags</A></H2>
<P>
Certain tags are not standalone; these are the ones that are interpreted as
part of a surrounding looping tag like <CODE>[loop]</CODE>, <CODE>[item-list]</CODE>, <CODE>[query]</CODE>, or <CODE>[region]</CODE>.

<P>
<PRE>    [PREFIX-accessories]
    [PREFIX-alternate]
    [PREFIX-calc]
    [PREFIX-change]
    [PREFIX-change]
    [PREFIX-code]
    [PREFIX-data]
    [PREFIX-description]
    [PREFIX-discount]
    [PREFIX-field]
    [PREFIX-increment]
    [PREFIX-last]
    [PREFIX-match]
    [PREFIX-modifier]
    [PREFIX-next]
    [PREFIX-param]
    [PREFIX-price]
    [PREFIX-quantity]
    [PREFIX-subtotal]
    [if-PREFIX-data]
    [if-PREFIX-field]
    [modifier-name]
    [quantity-name]
</PRE>
<P>

<FONT SIZE=-1>PREFIX</FONT> represents the prefix that is used in that
looping tag. They are only interpreted within their container and only
accept positional parameters. The default prefixes:

<P>
<PRE>    Tag           Prefix     Examples
    -----        --------   ----------
    [loop]        loop       [loop-code], [loop-field price], [loop-increment]
    [item-list]   item       [item-code], [item-field price], [item-increment]
    [search-list] item       [item-code], [item-field price], [item-increment]
    [query]       sql        [sql-code], [sql-field price], [sql-increment]
</PRE>
<P>
Sub-tag behavior is consistent among the looping tags. 

<P>
There are two types of looping lists; 
<FONT SIZE=-1>ARRAY</FONT> and 
<FONT SIZE=-1>HASH.</FONT>


<P>
An array list is the normal output of a <CODE>[query]</CODE>, a search, or a <CODE>[loop]</CODE>
tag. It returns from 1 to 
<FONT SIZE=-1>N</FONT> <CODE>return fields</CODE>, defined in the <CODE>mv_return_fields</CODE>
or <CODE>rf</CODE> variable or implicitly by means of a 
<FONT SIZE=-1>SQL</FONT> field list. The two queries below are essentially
identical:

<P>
<PRE>    [query sql=&quot;select foo, bar from products&quot;]
    [/query]
</PRE>
<P>
<PRE>    [loop search=&quot;
                    ra=yes
                    fi=products
                    rf=foo,bar
    &quot;]
</PRE>
<P>
Both will return an array of arrays consisting of the <CODE>foo</CODE> column and the <CODE>bar</CODE> column. The Perl data structure would look like:

<P>
<PRE>    [
        ['foo0', 'bar0'],
        ['foo1', 'bar1'],
        ['foo2', 'bar2'],
        ['fooN', 'barN'],
    ]
</PRE>
<P>

<FONT SIZE=-1>A</FONT> hash list is the normal output of the [item-list] tag. It returns the value of all return fields in an array of hashes. 
<FONT SIZE=-1>A</FONT> normal [item-list] return might look like:


<P>
<PRE>    [
        {
            code     =&gt; '99-102',
            quantity =&gt; 1,
            size     =&gt; 'XL',
            color    =&gt; 'blue',
            mv_ib    =&gt; 'products',
        },
        {
            code     =&gt; '00-341',
            quantity =&gt; 2,
            size     =&gt; undef,
            color    =&gt; undef,
            mv_ib    =&gt; 'products',
        },
            
    ]
</PRE>
<P>
You can also return hash lists in queries:

<P>
<PRE>    [query sql=&quot;select foo, bar from products&quot; type=hashref]
    [/query]
</PRE>
<P>
Now the data structure will look like:

<P>
<PRE>    [
        { foo =&gt; 'foo0', bar =&gt; 'bar0' },
        { foo =&gt; 'foo1', bar =&gt; 'bar1' },
        { foo =&gt; 'foo2', bar =&gt; 'bar2' },
        { foo =&gt; 'fooN', bar =&gt; 'barN' },
    ]
</PRE>
<DL>
<DT><STRONG><A NAME="item__PREFIX_accessories">[PREFIX-accessories arglist]</A></STRONG><DD>
<P>
The same as the [accessories ...] tag except always supplied the current
item code. If the list is a hash list, i.e. an [item-list], then the value
of the current item hash is passed so that a value default can be
established.

<DT><STRONG><A NAME="item__PREFIX_alternate">[PREFIX-alternate N] DIVISIBLE [else] NOT DIVISIBLE [/else][/PREFIX-alternate]</A></STRONG><DD>
<P>
Set up an alternation sequence. If the item-increment is divisible by 
<FONT SIZE=-1>`N',</FONT> the text will be displayed. If an `[else]NOT 
<FONT SIZE=-1>DIVISIBLE</FONT> TEXT[/else]' is present, then the 
<FONT SIZE=-1>NOT</FONT> 
<FONT SIZE=-1>DIVISIBLE</FONT> 
<FONT SIZE=-1>TEXT</FONT> will be displayed. For example:


<P>
<PRE>    [item-alternate 2]EVEN[else]ODD[/else][/item-alternate]
    [item-alternate 3]BY 3[else]NOT by 3[/else][/item-alternate]
</PRE>
<DT><STRONG><A NAME="item__PREFIX_calc_">[PREFIX-calc] 2 + [item-field price] [/PREFIX-calc]</A></STRONG><DD>
<P>
Calls perl via the equivalent of the [calc] [/calc] tag pair. Much faster
to execute.

<DT><STRONG><A NAME="item__PREFIX_change_conditoon_">[PREFIX-change][conditoon] ... [/condition] TEXT [/PREFIX-change]</A></STRONG><DD>
<P>
Sets up a breaking sequence that occurs when the contents of [condition]
[/condition] change. The most common one is a category break to nest or
place headers.

<P>
The region is only output when a field or other repeating value between
[condition] and [/condition] changes its value. This allows indented lists
similar to database reports to be easily formatted. The repeating value
must be a tag interpolated in the search process, such as
<CODE>[PREFIX-field field]</CODE> or <CODE>[PREFIX-data database field]</CODE>. If you need access to 
<FONT SIZE=-1>MML</FONT> tags, you can use [PREFIX-calc] with a
$Tag-&gt;foo() call.

<P>
Of course, this will only work as you expect when the search results are
properly sorted.

<P>
The value to be tested is contained within a
<CODE>[condition]value[/condition]</CODE> tag pair. The <CODE>[PREFIX-change]</CODE> tag also processes an <CODE>[else] [/else]</CODE> pair for output when the value does not change.

<P>
Here is a simple example for a search list that has a field <CODE>category</CODE> and
<CODE>subcategory</CODE> associated with each item:

<P>
<PRE> &lt;TABLE&gt;
 &lt;TR&gt;&lt;TH&gt;Category&lt;/TH&gt;&lt;TH&gt;Subcategory&lt;/TH&gt;&lt;TH&gt;Product&lt;/TH&gt;&lt;/TR&gt;
 [search-list]
 &lt;TR&gt;
    &lt;TD&gt;
         [item-change cat]
 
         [condition][item-field category][/condition]
 
                 [item-field category]
         [else]
                 &amp;nbsp;
         [/else]
         [/item-change]
    &lt;/TD&gt;
    &lt;TD&gt;
         [item-change]
 
         [condition][item-field subcategory][/condition]
 
                 [item-field subcategory]
         [else]
                 &amp;nbsp;
         [/else]
         [/on-change]
    &lt;/TD&gt;
    &lt;TD&gt; [item-field name] &lt;/TD&gt;
 [/search-list]
 &lt;/TABLE&gt;
</PRE>
<P>
The above should put out a table that only shows the category and
subcategory once, while showing the name for every product. (The <CODE>&amp;nbsp;</CODE>
will prevent blanked table cells if you use a border.)

<DT><STRONG><A NAME="item__PREFIX_code_">[PREFIX-code]</A></STRONG><DD>
<P>
The key or code of the current loop. In an [item-list] this is always the
product code; in a loop list it is the value of the current argument; in a
search it is whatever you have defined as the first mv_return_field (rf).

<DT><STRONG><A NAME="item__PREFIX_data">[PREFIX-data table field]</A></STRONG><DD>
<P>
Calls the column <CODE>field</CODE> in database table <A HREF="#item_table">table</A> for the current [PREFIX-code]. This may or may not be equivalent to <CODE>[PREFIX-field field]</CODE>
depending on whether your search table is defined as one of the <CODE>ProductFiles</CODE>.

<DT><STRONG><A NAME="item__PREFIX_description_">[PREFIX-description]</A></STRONG><DD>
<P>
The description of the current item, as defined in the <CODE>catalog.cfg</CODE> directive
<CODE>DescriptionField</CODE>. In the demo, it would be the value of the field <CODE>description</CODE>
in the table <CODE>products</CODE>.

<P>
If the list is a hash list, and the lookup of <CODE>DescriptionField</CODE> fails, then the attribute <CODE>description</CODE> will be substituted. This is useful to supply shopping cart descriptions
for on-the-fly items.

<DT><STRONG><A NAME="item__PREFIX_discount_">[PREFIX-discount]</A></STRONG><DD>
<P>
The price of the current item is calculated, and the difference between
that price and the list price (quantity one) price is output. This may have
different behavior than you expect if you set the [discount] [/discount]
tag along with quantity pricing.

<DT><STRONG><A NAME="item__PREFIX_field_">[PREFIX-field]</A></STRONG><DD>
<P>
Looks up a field value for the current item in one of several places, in
this order:

<P>
<PRE>    1. The first ProductFiles entry.
    2. Additional ProductFiles in the order they occur.
    3. The attribute value for the item in a hash list.
    4. Blank
</PRE>
<P>

<FONT SIZE=-1>A</FONT> common user error is to do this:

<P>
<PRE>    [loop search=&quot;
                    fi=foo
                    se=bar
                &quot;]
</PRE>
<P>
<PRE>    [loop-field foo_field]
    [/loop]
</PRE>
<P>
In this case, you are searching the table <CODE>foo</CODE> for a string of <CODE>bar</CODE>. When it is found, you wish to display the value of <CODE>foo_field</CODE>. Unless <CODE>foo</CODE> is in <CODE>ProductFiles</CODE> and the code is not present in a previous product file, you will get a
blank or some value you don't want. What you really want is <CODE>[loop-data foo foo_field]</CODE>, which specifically addresses the table <CODE>foo</CODE>.

<DT><STRONG><A NAME="item__PREFIX_increment_">[PREFIX-increment]</A></STRONG><DD>
<P>
The current count on the list, starting from either 1 in a zero-anchored
list like <CODE>[loop]</CODE> or <CODE>[item-list]</CODE>, or from the match count in a search list.

<P>
If you skip items with [PREFIX-last] or [PREFIX-next], the count is 
<FONT SIZE=-1>NOT</FONT> adjusted.

<DT><STRONG><A NAME="item__PREFIX_last_">[PREFIX-last] CONDITION [/PREFIX-last]</A></STRONG><DD>
<P>
If 
<FONT SIZE=-1>CONDITION</FONT> evaluates true (a non-whitespace value that
is not specifically zero) then this will be the last item displayed.

<DT><STRONG><A NAME="item__PREFIX_modifier">[PREFIX-modifier attribute]</A></STRONG><DD>
<P>
If the item is a hash list (i.e. [item-list]), this will return the value
of the <CODE>attribute</CODE>.

<DT><STRONG><A NAME="item__PREFIX_next_">[PREFIX-next] CONDITION [/PREFIX-next]</A></STRONG><DD>
<P>
If 
<FONT SIZE=-1>CONDITION</FONT> evaluates true (a non-whitespace value that
is not specifically zero) then this item is skipped.

<DT><STRONG><A NAME="item__PREFIX_param">[PREFIX-param name]</A></STRONG><DD>
<DT><STRONG>[PREFIX-param N]</STRONG><DD>
<P>
Returns the array parameter associated with the looping tag row. Each
looping list returns an array of <CODE>return fields</CODE>, set in searches with
<CODE>mv_return_field</CODE> or <CODE>rf</CODE>. The default is only to return the code of the search result, but by
setting those parameters you can return more than one item.

<P>
In a [query ...] 
<FONT SIZE=-1>MML</FONT> tag you can select multiple return fields with
something like:

<P>
<PRE>    [query prefix=prefix sql=&quot;select foo, bar from baz where foo=buz&quot;]
        [prefix-code]  [prefix-param foo]  [prefix-param bar]
    [/query]
</PRE>
<P>
In this case, [prefix-code] and [prefix-param foo] are synonymns, for
<CODE>foo</CODE> is the first returned parameter and becomes the code for this row. Another
synonym is [prefix-param 0]; and [prefix-param 1] is the same as
[prefix-param bar].

<DT><STRONG><A NAME="item__PREFIX_price_">[PREFIX-price]</A></STRONG><DD>
<P>
The price of the current code, formatted for currency. If MiniVend's
pricing routines cannot determine the price (i.e. it is not a valid product
or on-the-fly item) then zero is returned. If the list is a hash list, the
price will be modified by its <CODE>quantity</CODE> or other applicable attributes (like <CODE>size</CODE> in the demo).

<DT><STRONG><A NAME="item__PREFIX_quantity_">[PREFIX-quantity]</A></STRONG><DD>
<P>
The value of the <CODE>quantity</CODE> attribute in a hash list. Most commonly used to display the quantity of an
item in a shopping cart [item-list].

<DT><STRONG><A NAME="item__PREFIX_subtotal_">[PREFIX-subtotal]</A></STRONG><DD>
<P>
The [PREFIX-quantity] times the [PREFIX-price]. This does take discounts
into effect.

<DT><STRONG><A NAME="item__if_PREFIX_data">[if-PREFIX-data table field] IF text [else] ELSE text [/else] [/if-PREFIX-data]</A></STRONG><DD>
<P>
Examines the data field, i.e. [PREFIX-data table field], and if it is
non-blank and non-zero then the <CODE>IF text</CODE> will be returned. If it is false, i.e. blank or zero, the <CODE>ELSE text</CODE> will be returned to the page.

<P>
This is much more efficient than the otherwise equivalent
<CODE>[if type=data term=table::field::[PREFIX-code]]</CODE>.

<P>
You cannot place a condition; i.e. [if-PREFIX-data table field eq
'something']. Use <CODE>[if type=data ...]</CODE> for that.

<P>
Careful, a space is not a false value!

<DT><STRONG><A NAME="item__if_PREFIX_field">[if-PREFIX-field field] IF text [else] ELSE text [/else] [/if-PREFIX-field]</A></STRONG><DD>
<P>
Same as [if-PREFIX-data ...] except uses the same data rules as <CODE>[PREFIX-field]</CODE>.

<DT><STRONG><A NAME="item__modifier_name">[modifier-name attribute]</A></STRONG><DD>
<P>
Outputs a variable name which will set an appropriate variable name for
setting the attribute in a form (usually a shopping cart). Outputs for
successive items in the list:

<P>
<PRE>    1. attribute0
    2. attribute1
    3. attribute2
</PRE>
<P>
etc.

<DT><STRONG><A NAME="item__quantity_name_">[quantity-name]</A></STRONG><DD>
<P>
Outputs for successive items in the list:

<P>
<PRE>    1. quantity0
    2. quantity1
    3. quantity2
</PRE>
<P>
etc. <CODE>[modifier-name quantity]</CODE> would be the same as <CODE>[quantity-name]</CODE>.

</DL>
<P>
<HR>


code: 02.00
section: TITLE
type: overview
title: TITLE

<A NAME="TITLE">TITLE</A></H1>
<P>

<FONT SIZE=-1>MML</FONT> (Minivend Markup Language) 
<FONT SIZE=-1>TAG</FONT> 
<FONT SIZE=-1>REFERENCE</FONT>


<P>
<HR>


code: 03.00
section: DESCRIPTION
type: overview
title: DESCRIPTION

<A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
There are dozens of 
<FONT SIZE=-1>MML</FONT> pre-defined tag functions. If you don't see just
what you need, you can use <CODE>USER DEFINED TAGS</CODE> to create tags just as powerful as the pre-defined ones.

<P>
There are two styles of supplying parameters to a tag -- named and positional. In addition, you can usually embed MiniVend tags within 
<FONT SIZE=-1>HTML</FONT> tags.


<P>
In the named style you supply a parameter/value pair just as most 
<FONT SIZE=-1>HTML</FONT> tags use:

<P>
<PRE>    [value name=&quot;foo&quot;]
</PRE>
<P>
The same thing can be accomplished for the <A HREF="#item__value_">[value]</A> tag with

<P>
<PRE>    [value foo]
</PRE>
<P>
The parameter <A HREF="#item_name">name</A> is the first positional parameter for the <A HREF="#item__value_">[value]</A>
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.

<P>
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.

<P>
<STRONG>TIP:</STRONG> This will not work:

<P>
<PRE>    [page scan se=[scratch somevar]]
</PRE>
<P>
To get the output of the <CODE>[scratch somevar]</CODE> interpreted, you must place it within a named and quoted attribute:

<P>
<PRE>    [page href=scan arg=&quot;se=[scratch somevar]&quot;]
</PRE>
<P>
MiniVend tags can be specified within 
<FONT SIZE=-1>HTML</FONT> to make it easier to interface to some 
<FONT SIZE=-1>HTML</FONT> editors. Consider:


<P>
<PRE>    &lt;TABLE MV=&quot;if items&quot;&gt;
    &lt;TR MV=&quot;item-list&quot;&gt;
    &lt;TD&gt; [item-code] &lt;/TD&gt;
    &lt;TD&gt; [item-description] &lt;/TD&gt;
    &lt;TD&gt; [item-price] &lt;/TD&gt;
    &lt;/TR&gt;&lt;/TABLE&gt;
</PRE>
<P>
The above will loop over any items in the shopping cart, displaying their part number, description, and price, but only 
<FONT SIZE=-1>IF</FONT> there are items in the cart.


<P>
The same thing can be achieved with:

<P>
<PRE>    [if items]
    &lt;TABLE&gt;
    [item-list]
    &lt;TR&gt;
    &lt;TD&gt; [item-code] &lt;/TD&gt;
    &lt;TD&gt; [item-description] &lt;/TD&gt;
    &lt;TD&gt; [item-price] &lt;/TD&gt;
    &lt;/TR&gt;
    [/item-list]&lt;/TABLE&gt;
    [/if]
</PRE>
<P>
What is done with the results of the tag depends on whether it is a
<EM>container</EM> or <EM>standalone</EM> tag. 
<FONT SIZE=-1>A</FONT> container tag is one which has an end tag, i.e. <CODE>[tag] stuff [/tag]</CODE>. 
<FONT SIZE=-1>A</FONT> standalone tag has no end tag, as in [area
href=somepage]. (Note that [page ...] and [order ..] are <STRONG>not</STRONG> container tags.)

<P>

<FONT SIZE=-1>A</FONT> 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 <STRONG>reparse</STRONG> to 0. Note that you will almost always wish the default action. The only container 
<FONT SIZE=-1>MML</FONT> tag that doesn't have reparse set by default is
 <CODE>[mvasp]</CODE>.

<P>
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 
<FONT SIZE=-1>INTERPOLATE=1</FONT> tag modifier, which causes the interpretation to take place. It is frequent that you will
 <STRONG>not</STRONG>
want to interpret the contents of a [set variable] 
<FONT SIZE=-1>TAGS</FONT> [/set] pair, as that might contain tags which
should only be upon evaluating an order profile, search profile, or <EM>mv_click</EM> operation. If you wish to perform the evaluation at the time a variable is set, you would use [set name=variable interpolate=1] 
<FONT SIZE=-1>TAGS</FONT> [/set].


<P>
<HR>


code: 03.00
section: User_defined_Tags
type: overview
title: User-defined Tags

<A NAME="User_defined_Tags">User-defined Tags</A></H1>
<P>
MiniVend 3.04 allows the definition of user tags when using the new parsed 
<FONT SIZE=-1>HTML</FONT> syntax (a [new] tag is on the page). They will
not work with the old syntax. 3.06 adds the tags on a server-wide basis,
defined in <CODE>minivend.cfg</CODE>.

<P>
To define a tag that is catalog-specific, place <EM>UserTag</EM> directives in your catalog.cfg file. For server-wide tags, define them in
minivend.cfg. Catalog-specific tags take precedence if both are defined --
in fact, you can override the base MiniVend tag set with them. The
directive takes the form:

<P>
<PRE>   UserTag  tagname  property  value
</PRE>
<P>
where <CODE>tagname</CODE> is the name of the tag, <CODE>property</CODE> is the attribute (described below), and <A HREF="#item_value">value</A> is the value of the property for that tagname.

<P>
The user tags can either be based on Perl subroutines or just be aliases
for existing tags. Some quick examples are below.

<P>
An alias:

<P>
<PRE>    UserTag product_name Alias     data products title
</PRE>
<P>
This will change [product_name 99-102] into [data products title 99-102],
which will output the <CODE>title</CODE> database field for product code <CODE>99-102</CODE>. Don't use this with <CODE>[item-data ...]</CODE> and <CODE>[item-field ...]</CODE>, as they are parsed separately. You can do <CODE>[product-name [item-code]]</CODE>, though.

<P>

<FONT SIZE=-1>A</FONT> simple subroutine:

<P>
<PRE>    UserTag company_name Routine   sub { &quot;Your company name&quot; }
</PRE>
<P>
When you place a [company-name] tag in a MiniVend page, the text 
<CODE>Your company name</CODE> will be substituted.

<P>

<FONT SIZE=-1>A</FONT> subroutine with a passed text as an argument:

<P>
<PRE>    UserTag caps   Routine   sub { return &quot;\U@_&quot; }
    UserTag caps   HasEndTag 
</PRE>
<P>
The tag [caps]This text should be all upper case[/caps] will become
<CODE>THIS TEXT SHOULD BE ALL UPPER CASE</CODE>.

<P>
Here is a useful one you might wish to use:

<P>
<PRE>    UserTag quick_table HasEndTag
    UserTag quick_table Interpolate
    UserTag quick_table Order   border
    UserTag quick_table Routine &lt;&lt;EOF
    sub {
        my ($border,$input) = @_;
        $border = &quot; BORDER=$border&quot; if $border;
        my $out = &quot;&lt;TABLE ALIGN=LEFT$border&gt;&quot;;
        my @rows = split /\n+/, $input;
        my ($left, $right);
        for(@rows) {
            $out .= '&lt;TR&gt;&lt;TD ALIGN=RIGHT VALIGN=TOP&gt;';
            ($left, $right) = split /\s*:\s*/, $_, 2;
            $out .= '&lt;B&gt;' unless $left =~ /&lt;/;
            $out .= $left;
            $out .= '&lt;/B&gt;' unless $left =~ /&lt;/;
            $out .= '&lt;/TD&gt;&lt;TD VALIGN=TOP&gt;';
            $out .= $right;
            $out .= '&lt;/TD&gt;&lt;/TR&gt;';
            $out .= &quot;\n&quot;;
        }
        $out .= '&lt;/TABLE&gt;';
    }
    EOF
</PRE>
<P>
Called with:

<P>
<PRE>    [quick-table border=2]
    Name: [value name]
    City: [value city][if value state], [value state][/if] [value country]
    [/quick_table]
</PRE>
<P>
The properties for UserTag are are:

<DL>
<DT><STRONG><A NAME="item_Alias">Alias</A></STRONG><DD>
<P>
An alias for an existing (or other user-defined) tag. It takes the form:

<P>
<PRE>    UserTag tagname Alias    tag to insert
</PRE>
<P>
An Alias is the only property that does not require a <EM>Routine</EM>
to process the tag.

<DT><STRONG><A NAME="item_attrAlias">attrAlias</A></STRONG><DD>
<P>
An alias for an existing attribute for defined tag. It takes the form:

<P>
<PRE>    UserTag tagname attrAlias   alias attr
</PRE>
<P>
As an example, the standard MiniVend <A HREF="#item_value">value</A> tag takes a named attribute of <A HREF="#item_name">name</A> for the variable name, meaning that <CODE>[value name=var]</CODE>
will display the value of form field <CODE>var</CODE>. If you put this line in catalog.cfg:

<P>
<PRE>    UserTag value attrAlias   identifier name
</PRE>
<P>
then <CODE>[value identifier=var]</CODE> will be an equivalent tag.

<DT><STRONG><A NAME="item_CanNest">CanNest</A></STRONG><DD>
<P>
Notifies MiniVend that this tag must be checked for nesting. Only applies
to tags that have <EM>HasEndTag</EM> defined, of course. 
<FONT SIZE=-1>NOTE:</FONT> Your routine must handle the subtleties of
nesting, so don't use this unless you are quite conversant with parsing
routines. See the routines <CODE>tag_loop_list</CODE> and <CODE>tag_if</CODE> in lib/Vend/Interpolate.pm for an example of a nesting tag.

<P>
<PRE>    UserTag tagname CanNest
</PRE>
<DT><STRONG><A NAME="item_HasEndTag">HasEndTag</A></STRONG><DD>
<P>
Defines an ending [/tag] to encapsulate your text -- the text in between
the beginning <CODE>[tagname]</CODE> and ending <CODE>[/tagname]</CODE> will be the last argument sent to the defined subroutine.

<P>
<PRE>    UserTag tagname HasEndTag
</PRE>
<DT><STRONG><A NAME="item_Implicit">Implicit</A></STRONG><DD>
<P>
This defines a tag as implicit, meaning it can just be an <CODE>attribute</CODE> 
instead of an <CODE>attribute=value</CODE> pair. It must be a recognized attribute in the tag definition, or there
will be big problems. Use this with caution!

<P>
<PRE>    UserTag tagname Implicit attribute value
</PRE>
<P>
If you want to set a standard include file to a fixed value by default, but
don't want to have to specify <CODE>[include file=&quot;/long/path/to/file&quot;]</CODE>
every time, you can just put:

<P>
<PRE>    UserTag include Implicit file file=/long/path/to/file
</PRE>
<P>
and <CODE>[include file]</CODE> will be the equivalent. You can still specify another value with C[include
file=``/another/path/to/file'']

<DT><STRONG><A NAME="item_InsertHTML">InsertHTML</A></STRONG><DD>
<P>
This attribute makes 
<FONT SIZE=-1>HTML</FONT> tag output be inserted into the containing tag,
in effect adding an attribute=value pair (or pairs).

<P>
<PRE>    UserTag tagname InsertHTML   htmltag  mvtag|mvtag2|mvtagN
</PRE>
<P>
In MiniVend's standard tags, among others, the 
<FONT SIZE=-1>&lt;OPTION</FONT> ...&gt; tag has the [selected ..] and
[checked ...] tags included with them, so that you can do:

<P>
<PRE>   &lt;INPUT TYPE=checkbox
        MV=&quot;checked mvshipmode upsg&quot; NAME=mv_shipmode&gt; UPS Ground shipping
</PRE>
<P>
to expand to this:

<P>
<PRE>   &lt;INPUT TYPE=checkbox CHECKED NAME=mv_shipmode&gt; UPS Ground shipping
</PRE>
<P>
Providing, of course, that <CODE>mv_shipmode</CODE>  <STRONG>is</STRONG> equal to <CODE>upsg</CODE>. If you want to turn off this behavior on a per-tag basis, add the
attribute mv.noinsert=1 to the tag on your page.

<DT><STRONG><A NAME="item_InsideHTML">InsideHTML</A></STRONG><DD>
<P>
To make a container tag be placed <STRONG>after</STRONG> the containing 
<FONT SIZE=-1>HTML</FONT> tag, use the InsideHTML setting.

<P>
<PRE>    UserTag tagname InsideHTML   htmltag  mvtag|mvtag2|mvtagN
</PRE>
<P>
In MiniVend's standard tags, the only InsideHTML tag is the &lt;
<FONT SIZE=-1>SELECT&gt;</FONT> tag when used with <EM>loop</EM>, which causes this:

<P>
<PRE>   &lt;SELECT MV=&quot;loop upsg upsb upsr&quot; NAME=mv_shipmode&gt;
   &lt;OPTION VALUE=&quot;[loop-code]&quot;&gt; [shipping-desc [loop-code]]
   &lt;/SELECT&gt;
</PRE>
<P>
to expand to this:

<P>
<PRE>   &lt;SELECT NAME=mv_shipmode&gt;
   [loop upsg upsb upsr]
   &lt;OPTION VALUE=&quot;[loop-code]&quot;&gt; [shipping-desc [loop-code]]
   [/loop]
   &lt;/SELECT&gt;
</PRE>
<P>
Without the InsideHTML setting, the [loop ...] would have been <STRONG>outside</STRONG>
of the select -- not what you want. If you want to turn off this behavior
on a per-tag basis, add the attribute mv.noinside=1 to the tag on your
page.

<DT><STRONG><A NAME="item_Interpolate">Interpolate</A></STRONG><DD>
<P>
The behavior for this attribute depends on whether the tag is a container
(i.e. <A HREF="#item_HasEndTag">HasEndTag</A> is defined). If it is not a container, the <A HREF="#item_Interpolate">Interpolate</A>
attribute causes the <STRONG>the resulting HTML</STRONG> from the <CODE>UserTag</CODE> will be re-parsed for more MiniVend tags. If it is a container, <A HREF="#item_Interpolate">Interpolate</A>
causes the contents of the tag to be parsed <STRONG>before</STRONG> the tag routine is run.

<P>
<PRE>    UserTag tagname Interpolate
</PRE>
<DT><STRONG><A NAME="item_InvalidateCache">InvalidateCache</A></STRONG><DD>
<P>
If this is defined, the presence of the tag on a page will prevent search
cache, page cache, and static builds from operating on the page.

<P>
<PRE>    UserTag tagname InvalidateCache
</PRE>
<P>
It does not override [tag flag build][/tag], though.

<DT><STRONG><A NAME="item_Order">Order</A></STRONG><DD>
<P>
The optional arguments that can be sent to the tag. This defines not only
the order in which they will be passed to <EM>Routine</EM>, but the name of the tags. If encapsulated text is appropriate (<EM>HasEndTag</EM> is set), it will be the last argument.

<P>
<PRE>    UserTag tagname Order param1 param2
</PRE>
<DT><STRONG><A NAME="item_PosRoutine">PosRoutine</A></STRONG><DD>
<P>
Identical to the Routine argument -- a subroutine that will be called when
the new syntax is not used for the call, i.e. <CODE>[usertag argument]</CODE> instead of <CODE>[usertag ARG=argument]</CODE>. If not defined, <EM>Routine</EM> is used, and MiniVend will usually do the right thing.

<DT><STRONG><A NAME="item_ReplaceAttr">ReplaceAttr</A></STRONG><DD>
<P>
Works in concert with InsertHTML, defining a <STRONG>single</STRONG> attribute which will be replaced in the insertion operation..

<P>
<PRE>  UserTag tagname ReplaceAttr  htmltag attr
</PRE>
<P>
An example is the standard 
<FONT SIZE=-1>HTML</FONT> &lt;
<FONT SIZE=-1>A</FONT> 
<FONT SIZE=-1>HREF=...&gt;</FONT> tag. If you want to use the MiniVend tag
 <CODE>[area pagename]</CODE> inside of it, then you would normally want to replace the 
<FONT SIZE=-1>HREF</FONT> attribute. So the equivalent to the following is
defined within MiniVend:

<P>
<PRE>  UserTag  area  ReplaceAttr  a  href
</PRE>
<P>
Causing this

<P>
<PRE>    &lt;A MV=&quot;area pagename&quot; HREF=&quot;a_test_page.html&quot;&gt;
</PRE>
<P>
to become

<P>
<PRE>    &lt;A HREF=&quot;<A HREF="http://yourserver/cgi/simple/pagename?X8sl2lly">http://yourserver/cgi/simple/pagename?X8sl2lly</A>;;44&quot;&gt;
 
when intepreted.
    
=item ReplaceHTML
</PRE>
<P>
For HTML-style tag use only. Causes the tag containing the MiniVend tag to
be stripped and the result of the tag to be inserted, for certain tags. For
example:

<P>
<PRE>  UserTag company_name Routine sub { my $l = shift; return &quot;$l: XYZ Company&quot; }
  UserTag company_name HasEndTag
  UserTag company_name ReplaceHTML  b    company_name
</PRE>
<P>

<FONT SIZE=-1>&lt;BR&gt;</FONT> is the 
<FONT SIZE=-1>HTML</FONT> tag, and ``company_name'' is the MiniVend tag. At that point, the usage:


<P>
<PRE>    &lt;B MV=&quot;company-name&quot;&gt; Company &lt;/B&gt;  ---&gt;&gt;  Company: XYZ Company
</PRE>
<P>
Tags not in the list will not be stripped:

<P>
<PRE>    &lt;I MV=&quot;company-name&quot;&gt; Company &lt;/I&gt; ---&gt;&gt;  &lt;I&gt;Company: XYZ Company&lt;/I&gt;
</PRE>
<DT><STRONG><A NAME="item_Routine">Routine</A></STRONG><DD>
<P>
An inline subroutine that will be used to process the arguments of the tag.
It must not be named, and will be allowed to access unsafe elements only if
the <CODE>minivend.cfg</CODE> parameter <EM>AllowGlobal</EM> is set for the catalog.

<P>
<PRE>    UserTag tagname Routine  sub { &quot;your perl code here!&quot; }
</PRE>
<P>
The routine may use a ``here'' document for readability:

<P>
<PRE>    UserTag tagname Routine &lt;&lt;EOF
    sub {
        my ($param1, $param2, $text) = @_;
        return &quot;Parameter 1 is $param1, Parameter 2 is $param2&quot;;
    }
    EOF
</PRE>
<P>
The usual <EM>here documents</EM> caveats apply.

<P>
Parameters defined with the <EM>Order</EM> property will be sent to the routine first, followed by any encapsulated
text (<EM>HasEndTag</EM> is set).

</DL>
<P>
Note that the UserTag facility, combined with AllowGlobal, allows the user
to define tags just as powerful as the standard MiniVend tags. This is not
recommended for the novice, though -- keep it simple. 8-)

</BODY>

</HTML>


code: 03.02
section: TAGS
type: item
title: accessories

<A NAME="accessories">accessories</A></H2>
<DL>
<DT><STRONG><A NAME="item_CALL">CALL INFORMATION</A></STRONG><DD>
<P>
Parameters: <STRONG>code arg</STRONG>



<P>
Positional parameters in same order.

<P>
<STRONG>The attribute hash reference is passed</STRONG> to the subroutine after the parameters as the last argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;accessories(
        {
         code =&gt; VALUE,
         arg =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;accessories($code, $arg, $ATTRHASH);
</PRE>
<P>
Attribute aliases

<P>
<PRE>            base ==&gt; table
            col ==&gt; column
            database ==&gt; table
            db ==&gt; table
            field ==&gt; column
            key ==&gt; code
            row ==&gt; code
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG><A NAME="item_DESCRIPTION">DESCRIPTION</A></STRONG><DD>
<P>
The <CODE>[accessories ...]</CODE> tag allows you to access MiniVend's option attribute facility in any of
several ways.

<P>
If passed any of the optional arguments, initiates special processing of
item attributes based on entries in the product database.

<P>
MiniVend allows item attributes to be set for each ordered item. This
allows a size, color, or other modifier to be attached to a line item in
the shopping cart. Previous attribute values can be resubmitted by means of
a hidden field on a form.

<P>
The <CODE>catalog.cfg</CODE> file directive <EM>UseModifier</EM> is used to set the name of the modifier or modifiers. For example

<P>
<PRE>    UseModifier        size color
</PRE>
<P>
will attach both a size and color attribute to each item code that is
ordered.

<P>
<STRONG>IMPORTANT NOTE:</STRONG> You may not use the following names for attributes:

<P>
<PRE>    item  group  quantity  code  mv_ib  mv_mi  mv_si
</PRE>
<P>
You can also set it in scratch with the mv_UseModifier scratch variable -- <CODE>[set mv_UseModifier]size color[/set]</CODE> has the same effect as above. This allows multiple options to be set for
products. Whichever one is in effect at order time will be used. Be
careful, you cannot set it more than once on the same page. Setting the <CODE>mv_separate_items</CODE> or global directive <EM>SeparateItems</EM>
places each ordered item on a separate line, simplifying attribute
handling. The scratch setting for <CODE>mv_separate_items</CODE> has the same effect.

<P>
The modifier value is accessed in the <CODE>[item-list]</CODE> loop with the
<CODE>[item-param attribute]</CODE> tag, and form input fields are placed with the
<CODE>[modifier-name attribute]</CODE> tag. This is similar to the way that quantity is handled.

<P>

<FONT SIZE=-1>NOTE:</FONT> You must be sure that no fields in your forms
have digits appended to their names if the variable is the same name as the
attribute name you select, as the <CODE>[modifier-name size]</CODE> variables will be placed in the user session as the form variables size0,
size1, size2, etc.

<P>
MiniVend will automatically generate the select boxes when the <CODE>[accessories &lt;code</CODE> size]&gt; or <CODE>[item-accessories size]</CODE>
tags are called. They have the syntax:

<P>
<PRE>   [item_accessories attribute, type*, column*, table*, name*, outboard*]
  
   [accessories code=sku
                attribute=modifier
                type=&quot;select|radio|display|show|checkbox|text|textarea&quot;*
                column=column_name*
                table=db_table*
                name=varname
                outboard=key
                passed=&quot;value=label, value2, value3=label 3&quot; ]
</PRE>
<DL>
<DT><STRONG><A NAME="item_code">code</A></STRONG><DD>
<P>
Not needed for item-accessories, this is the product code of the item to
reference. =item attribute

<P>
The item attribute as specified in the UseModifier configuration directive.
Typical are <CODE>size</CODE> or <CODE>color</CODE>.

<DT><STRONG><A NAME="item_type">type</A></STRONG><DD>
<P>
The action to be taken. One of:

<P>
<PRE>  select          Builds a dropdown &lt;SELECT&gt; menu for the attribute.
                  NOTE: This is the default.
 
  multiple        Builds a multiple dropdown &lt;SELECT&gt; menu for the
                  attribute.  The size is equal to the number of
                  option choices.
                   
  display         Shows the label text for *only the selected option*.
   
  show            Shows the option choices (no labels) for the option.
   
  radio           Builds a radio box group for the item, with spaces
                  separating the elements.
                   
  radio nbsp      Builds a radio box group for the item, with &amp;nbsp;
                  separating the elements.
                   
  radio left n    Builds a radio box group for the item, inside a
                  table, with the checkbox on the left side. If &quot;n&quot;
                  is present and is a digit from 2 to 9, it will align
                  the options in that many columns.
                   
  radio right n   Builds a radio box group for the item, inside a
                  table, with the checkbox on the right side. If &quot;n&quot;
                  is present and is a digit from 2 to 9, it will align
                  the options in that many columns.
</PRE>
<P>
<PRE>   
  check           Builds a checkbox group for the item, with spaces
                  separating the elements.
                   
  check nbsp      Builds a checkbox group for the item, with &amp;nbsp;
                  separating the elements.
                   
  check left n    Builds a checkbox group for the item, inside a
                  table, with the checkbox on the left side. If &quot;n&quot;
                  is present and is a digit from 2 to 9, it will align
                  the options in that many columns.
                   
  check right n   Builds a checkbox group for the item, inside a
                  table, with the checkbox on the right side. If &quot;n&quot;
                  is present and is a digit from 2 to 9, it will align
                  the options in that many columns.
</PRE>
<P>
<PRE>  textarea_XX_YY  A textarea with XX columns and YY rows
</PRE>
<P>
<PRE>  text_XX         A text box with XX size in characters
</PRE>
<P>
The default is 'select', which builds an 
<FONT SIZE=-1>HTML</FONT> select form entry for the attribute. Also
recognized is 'multiple', which generates a multiple-selection drop down
list, 'show', which shows the list of possible attributes, and 'display',
which shows the label text for the selected option only.

<DT><STRONG><A NAME="item_column">column</A></STRONG><DD>
<P>
The database column name to be used to build the entry (usually a field in
the products database). Defaults to a field named the same as the
attribute.

<DT><STRONG><A NAME="item_table">table</A></STRONG><DD>
<P>
The database table to find <STRONG>column</STRONG> in, defaults to the first products file where the item code is found.

<DT><STRONG><A NAME="item_name">name</A></STRONG><DD>
<P>
Name of the form variable to use if a form is being built. Defaults to
mv_order_<STRONG>attribute</STRONG> -- i.e. if the attribute is <STRONG>size</STRONG>, the form variable will be named <STRONG>mv_order_size</STRONG>. If the variable is set in the user session, the widget will ``remember''
its previous setting.

<DT><STRONG><A NAME="item_outboard">outboard</A></STRONG><DD>
<P>
If calling the item-accessories tag, and you wish to select from an
outboard database table with a different key from the item code, you can
pass the key to use to find the accessory data.

</DL>
<P>
When called with an attribute, the database is consulted and looks for a
comma-separated list of attribute options. They take the form:

<P>
<PRE>    name=Label Text, name=Label Text*
</PRE>
<P>
The label text is optional -- if none is given, the <STRONG>name</STRONG> will be used.

<P>
If an asterisk is the last character of the label text, the item is the
default selection. If no default is specified, the first will be the
default. An example:

<P>
<PRE>    [item_accessories color]
</PRE>
<P>
This will search the product database for a field named ``color''. If an
entry ``beige=Almond, gold=Harvest Gold, White*, green=Avocado'' is found,
a select box like this will be built:

<P>
<PRE>    &lt;SELECT NAME=&quot;mv_order_color&quot;&gt;
    &lt;OPTION VALUE=&quot;beige&quot;&gt;Almond
    &lt;OPTION VALUE=&quot;gold&quot;&gt;Harvest Gold
    &lt;OPTION SELECTED&gt;White
    &lt;OPTION VALUE=&quot;green&quot;&gt;Avocado
    &lt;/SELECT&gt;
</PRE>
<P>
In combination with the <CODE>mv_order_item</CODE> and <CODE>mv_order_quantity</CODE> variables this can be used to allow entry of an attribute at time of order.

<P>
If used in an item list, and the user has changed the value, the generated
select box will automatically retain the current value the user has
selected.

<P>
The value can then be displayed with <CODE>[item-modifier size]</CODE> on the order report, order receipt, or any other page containing an
<CODE>[item-list]</CODE>. 

<P>
When called with an attribute, the database is consulted and looks for a
comma-separated list of attribute options. They take the form:

<P>
<PRE>    name=Label Text, name=Label Text*
</PRE>
<P>
The label text is optional -- if none is given, the <STRONG>name</STRONG> will be used.

<P>
If an asterisk is the last character of the label text, the item is the
default selection. If no default is specified, the first will be the
default. An example:

<P>
<PRE>    [accessories TK112 color]
</PRE>
<P>
This will search the product database for a field named ``color''. If an
entry ``beige=Almond, gold=Harvest Gold, White*, green=Avocado'' is found,
a select box like this will be built:

<P>
<PRE>    &lt;SELECT NAME=&quot;mv_order_color&quot;&gt;
    &lt;OPTION VALUE=&quot;beige&quot;&gt;Almond
    &lt;OPTION VALUE=&quot;gold&quot;&gt;Harvest Gold
    &lt;OPTION SELECTED&gt;White
    &lt;OPTION VALUE=&quot;green&quot;&gt;Avocado
    &lt;/SELECT&gt;
</PRE>
<P>
In combination with the <EM>mv_order_item</EM> and <EM>mv_order_quantity</EM> variables this can be used to allow entry of an attribute at time of order.

<DL>
<DT><STRONG><A NAME="item_EMULATING">EMULATING WITH LOOP</A></STRONG><DD>
<P>
Below is a fragment from a shopping basket display form which shows a
selectable size with ``sticky'' setting and a price that changes based upon
the modifier setting. Note that this would normally be contained within the <CODE>[item_list]</CODE>  <CODE>[/item-list]</CODE>
pair.

<P>
<PRE>    &lt;SELECT NAME=&quot;[modifier-name size]&quot;&gt;
    [loop option=&quot;[modifier-name size]&quot; list=&quot;S, M, L, XL&quot;]
    &lt;OPTION&gt; [loop-code] -- [price code=&quot;[item-code]&quot; size=&quot;[loop-code]&quot;]
    [/loop]
    &lt;/SELECT&gt;
</PRE>
<P>
The above is essentially the same as would be output with the
[item-accessories size] tag if the product database field <CODE>size</CODE>
contained the value <CODE>S, M, L, XL</CODE>, but contains the adjusted price.

</DL>
</DL>
<P>
<HR>


code: 03.03
section: TAGS
type: item
title: and

<A NAME="and">and</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>type term op compare</STRONG>



<P>

<FONT SIZE=-1>THIS</FONT> 
<FONT SIZE=-1>TAG</FONT> 
<FONT SIZE=-1>HAS</FONT> 
<FONT SIZE=-1>SPECIAL</FONT> 
<FONT SIZE=-1>POSITIONAL</FONT> 
<FONT SIZE=-1>PARAMETER</FONT> 
<FONT SIZE=-1>HANDLING.</FONT>


<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
Called Routine for positonal: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;and(
        {
         type =&gt; VALUE,
         term =&gt; VALUE,
         op =&gt; VALUE,
         compare =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;and($type, $term, $op, $compare);
</PRE>
<P>
Attribute aliases

<P>
<PRE>            base ==&gt; type
            comp ==&gt; compare
            operator ==&gt; op
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
The [and ...] tag is only used in conjunction with [if ...]. Example:

<P>
<PRE>        [if value fname]
        [and value lname]
        Both first and last name are present.
        [else]
        Missing one of &quot;fname&quot; and &quot;lname&quot; from $Values.
        [/else]
        [/if]
</PRE>
<P>
See <CODE>[if ...]</CODE>.

</DL>
<P>
<HR>


code: 03.04
section: TAGS
type: item
title: area

<A NAME="area">area</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Aliases for tag

<P>
href

<P>
Parameters: <STRONG>href arg</STRONG>



<P>
Positional parameters in same order.

<P>
<STRONG>The attribute hash reference is passed</STRONG> to the subroutine after the parameters as the last argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;area(
        {
         href =&gt; VALUE,
         arg =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;area($href, $arg, $ATTRHASH);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
Named call example:

<P>
<PRE>    &lt;A HREF=&quot;[area href=scan arg=&quot;
                                     se=Impressionists
                                     sf=category
                                &quot;
                            ]&quot;&gt;Impressionists&lt;/A&gt;
</PRE>
<P>
Positional call example:

<P>
<PRE>    &lt;A HREF=&quot;[area ord/basket]&quot;&gt;Check basket&lt;/A&gt;
</PRE>
<P>

<FONT SIZE=-1>HTML</FONT> example:

<P>
<PRE>    &lt;A MV=&quot;area dir/page&quot; HREF=&quot;dir/page.html&quot;&gt;
</PRE>
<P>
Produces the 
<FONT SIZE=-1>URL</FONT> to call a MiniVend page, without the surrounding 
<FONT SIZE=-1>A</FONT> 
<FONT SIZE=-1>HREF</FONT> notation. This can be used to get control of your 
<FONT SIZE=-1>HREF</FONT> items, perhaps to place an 
<FONT SIZE=-1>ALT</FONT> string or a Javascript construct.


<P>
It was originally named <CODE>area</CODE> because it also can be used in a client-side image map, and has an alias of <CODE>href</CODE>. The two links below are identical in operation:

<P>
<PRE>   &lt;A HREF=&quot;[area href=catalog]&quot; ALT=&quot;Main catalog page&quot;&gt;Catalog Home&lt;/A&gt;
   &lt;A HREF=&quot;[href href=catalog]&quot; ALT=&quot;Main catalog page&quot;&gt;Catalog Home&lt;/A&gt;
</PRE>
<P>
The optional <EM>arg</EM> is used just as in the <EM>page</EM> tag.

<P>
The optional <CODE>form</CODE> argument allows you to encode a form in the link.

<P>
<PRE>        &lt;A HREF=&quot;[area form=&quot;
                mv_order_item=99-102
                mv_order_size=L
                mv_order_quantity=1
                mv_separate_items=1
                mv_todo=refresh&quot;
        ]&quot;&gt; Order t-shirt in Large size &lt;/A&gt;
</PRE>
<P>
The two form values <EM>mv_session_id</EM> and <EM>mv_arg</EM> are automatically added when appropriate. (<EM>mv_arg</EM> is the <CODE>arg</CODE> parameter for the tag.)

<P>
If the parameter <CODE>href</CODE> is not supplied, <EM>process</EM> is used, causing normal MiniVend form processing.

<P>
This would generate a form that ordered item number 99-102 on a separate
line (<CODE>mv_separate_items</CODE> being set), with size <CODE>L</CODE>, in quantity 2. Since the page is not set, you will go to the default
shopping cart page -- equally you could set <CODE>mv_orderpage=yourpage</CODE>
to go to <CODE>yourpage</CODE>.

<P>
All normal MiniVend form caveats apply -- you must have an action, you must
supply a page if you don't want to go to the default, etc.

<P>
You can theoretically submit any form with this, though none of the
included values can have newlines or trailing whitespace. If you want to do
something like that you will have to write a UserTag.

</DL>
<P>
<HR>


code: 03.05
section: TAGS
type: item
title: banner

<A NAME="banner">banner</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>category</STRONG>



<P>
Positional parameters in same order.

<P>
<STRONG>The attribute hash reference is passed</STRONG> to the subroutine after the parameters as the last argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;banner(
        {
         category =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;banner($category, $ATTRHASH);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
The [banner ...] tag is designed to implement random or rotating banner
displays in your Minivend pages. See the main Minivend documentation,
section <EM>Banner/Ad rotation</EM>.

</DL>
<P>
<HR>


code: 03.06
section: TAGS
type: item
title: bounce

<A NAME="bounce">bounce</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>href if</STRONG>



<P>
Positional parameters in same order.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;bounce(
        {
         href =&gt; VALUE,
         if =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;bounce($href, $if);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
The [bounce ...] tag is designed to send an 
<FONT SIZE=-1>HTTP</FONT> redirect (302 status code) to the browser and
redirect it to another (possibly MiniVend-parsed) page.

<P>
It will stop 
<FONT SIZE=-1>MML</FONT> code execution at that point; further tags will
not be run through the parser. Bear in mind that if you are inside a
looping list, that list will run to completion and the [bounce] tag will
not be seen until the loop is complete.

<P>
Example of bouncing to a MiniVend parsed page:

<P>
<PRE>        [if !scratch real_user]
        [bounce href=&quot;[area violation]&quot;]
        [/if]
</PRE>
<P>
Note the 
<FONT SIZE=-1>URL</FONT> is produced by the <CODE>[area ...]</CODE> 
<FONT SIZE=-1>MML</FONT> tag.

<P>
Since the 
<FONT SIZE=-1>HTTP</FONT> says the 
<FONT SIZE=-1>URL</FONT> needs to be absolute, this one might cause a browser warning:


<P>
<PRE>        [if value go_home]
        [bounce href=&quot;/&quot;]
        [/if]
</PRE>
<P>
But running something like one of the MiniVend demos you can do:

<P>
<PRE>        [if value go_home]
        [bounce href=&quot;__SERVER_NAME__/&quot;]
        [/if]
</PRE>
<P>
<PRE>        [if value go_home]
        [bounce href=&quot;/&quot;]
        [/if]
</PRE>
</DL>
<P>
<HR>


code: 03.07
section: TAGS
type: item
title: calc

<A NAME="calc">calc</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
No parameters.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Interpolates <STRONG>container text</STRONG> by default&gt;.

<P>
This is a container tag, i.e. [calc] 
<FONT SIZE=-1>FOO</FONT> [/calc]. Nesting: 
<FONT SIZE=-1>NO</FONT>


<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;calc(
        {
        },
        BODY
    )
  
 OR
 
    $Tag-&gt;calc($BODY);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
syntax: [calc] 
<FONT SIZE=-1>EXPRESSION</FONT> [/calc]

<P>
Starts a region where the arguments are calculated according to normal
arithmetic symbols. For instance:

<P>
<PRE>    [calc] 2 + 2 [/calc]
</PRE>
<P>
will display:

<P>
<PRE>    4
</PRE>
<P>
The [calc] tag is really the same as the [perl] tag, except that it doesn't
accept arguments, interpolates surrounded MiniVend tags by default, and is
slightly more efficient to parse.

<P>

<FONT SIZE=-1>TIP:</FONT> The [calc] tag will remember variable values
inside one page, so you can do the equivalent of a memory store and memory
recall for a loop.

<P>

<FONT SIZE=-1>ASP</FONT> 
<FONT SIZE=-1>NOTE:</FONT> There is never a reason to use this tag in a [perl] or 
<FONT SIZE=-1>ASP</FONT> section.


</DL>
<P>
<HR>


code: 03.08
section: TAGS
type: item
title: cart

<A NAME="cart">cart</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>name</STRONG>



<P>
Positional parameters in same order.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>YES</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;cart(
        {
         name =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;cart($name);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
Sets the name of the current shopping cart for display of shipping, price,
total, subtotal, shipping, and nitems tags. 

</DL>
<P>
<HR>


code: 03.09
section: TAGS
type: item
title: catch

<A NAME="catch">catch</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>label</STRONG>



<P>

<FONT SIZE=-1>ONLY</FONT> 
<FONT SIZE=-1>THE</FONT> <STRONG></STRONG> 
<FONT SIZE=-1>PARAMETERS</FONT> 
<FONT SIZE=-1>ARE</FONT> 
<FONT SIZE=-1>POSITIONAL.</FONT>


<P>
<STRONG>The attribute hash reference is passed</STRONG> after the parameters but before the container text argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
This is a container tag, i.e. [catch] 
<FONT SIZE=-1>FOO</FONT> [/catch]. Nesting: 
<FONT SIZE=-1>NO</FONT>


<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;catch(
        {
         label =&gt; VALUE,
        },
        BODY
    )
  
 OR
 
    $Tag-&gt;catch($label, $ATTRHASH, $BODY);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.10
section: TAGS
type: item
title: cgi

<A NAME="cgi">cgi</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>name</STRONG>



<P>
Positional parameters in same order.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>YES</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;cgi(
        {
         name =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;cgi($name);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.11
section: TAGS
type: item
title: checked

<A NAME="checked">checked</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>name value multiple default</STRONG>



<P>
Positional parameters in same order.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>YES</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;checked(
        {
         name =&gt; VALUE,
         value =&gt; VALUE,
         multiple =&gt; VALUE,
         default =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;checked($name, $value, $multiple, $default);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
You can provide a ``memory'' for drop-down menus, radio buttons, and
checkboxes with the [checked] and [selected] tags.

<P>
<PRE>    &lt;INPUT TYPE=radio NAME=foo
            VALUE=on [checked name=foo value=on default=1]&gt;
    &lt;INPUT TYPE=radio NAME=foo
            VALUE=off [checked name=foo value=off]&gt;
</PRE>
<P>
This will output 
<FONT SIZE=-1>CHECKED</FONT> if the variable <CODE>var_name</CODE> is equal to
<A HREF="#item_value">value</A>. Not case sensitive.

<P>
The <CODE>default</CODE> parameter, if true (non-zero and non-blank), will cause the box to be
checked if the variable has never been defined.

<P>
Note that 
<FONT SIZE=-1>CHECKBOX</FONT> items will never submit their value if not
checked, so the box will not be reset. You must do something like:

<P>
<PRE>    &lt;INPUT TYPE=checkbox NAME=foo
            VALUE=1 [checked name=foo value=1 default=1]&gt;
    [value name=foo set=&quot;&quot;]
</PRE>
</DL>
<P>
<HR>


code: 03.12
section: TAGS
type: item
title: currency

<A NAME="currency">currency</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>convert noformat</STRONG>



<P>
Positional parameters in same order.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Interpolates <STRONG>container text</STRONG> by default&gt;.

<P>
This is a container tag, i.e. [currency] 
<FONT SIZE=-1>FOO</FONT> [/currency]. Nesting: 
<FONT SIZE=-1>NO</FONT>


<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;currency(
        {
         convert =&gt; VALUE,
         noformat =&gt; VALUE,
        },
        BODY
    )
  
 OR
 
    $Tag-&gt;currency($convert, $noformat, $BODY);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
When passed a value of a single number, formats it according to the
currency specification. For instance:

<P>
<PRE>    [currency]4[/currency]
</PRE>
<P>
will display:

<P>
<PRE>    4.00
</PRE>
<P>
or something else depending on the <EM>Locale</EM> and PriceCommas settings. It can contain a [calc] region. If the optional
``convert'' parameter is set, it will convert the value according to
PriceDivide&gt; for the current locale. If Locale is set to <CODE>fr_FR</CODE>, and <EM>PriceDivide</EM> for <CODE>fr_FR</CODE>
is 0.167, the following sequence

<P>
<PRE>    [currency convert=1] [calc] 500.00 + 1000.00 [/calc] [/currency]
</PRE>
<P>
will cause the number 8.982,04 to be displayed.

</DL>
<P>
<HR>


code: 03.13
section: TAGS
type: item
title: data

<A NAME="data">data</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>table field key</STRONG>



<P>
Positional parameters in same order.

<P>
<STRONG>The attribute hash reference is passed</STRONG> to the subroutine after the parameters as the last argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;data(
        {
         table =&gt; VALUE,
         field =&gt; VALUE,
         key =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;data($table, $field, $key, $ATTRHASH);
</PRE>
<P>
Attribute aliases

<P>
<PRE>            base ==&gt; table
            code ==&gt; key
            col ==&gt; field
            column ==&gt; field
            database ==&gt; table
            name ==&gt; field
            row ==&gt; key
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
Syntax: [data table=db_table column=column_name key=key
filter=``uc|lc|name|namecase|no_white|etc.''* append=1* value=``value to
set to''* increment=1* ]

<P>
Returns the value of the field in a database table, or 
<FONT SIZE=-1>(DEPRECATED)</FONT> from the <A HREF="#item_session">session</A>
namespace. If the optional <STRONG>value</STRONG> is supplied, the entry will be changed to that value. If the option
increment* is present, the field will be atomically incremented with the
value in <STRONG>value</STRONG>. Use negative numbers in <A HREF="#item_value">value</A> to decrement. The <CODE>append</CODE> attribute causes the value to be appended; and finally, the <CODE>filter</CODE> attribute is a set of MiniVend filters that are applied to the data 1)
after it is read; or 2)before it is placed in the table.

<P>
If a DBM-based database is to be modified, it must be flagged writable on
the page calling the write tag. Use [tag flag write]products[/tag] to mark
the <CODE>products</CODE> database writable, for example.
<STRONG>This must be done before ANY access to that table.</STRONG>



<P>

<FONT SIZE=-1>DEPRECATED</FONT> 
<FONT SIZE=-1>BEHAVIOR:</FONT> (replace with
 <A HREF="#item_session">session</A> tag). In addition, the <A HREF="#item__data_">[data ...]</A> tag can access a number of elements in the MiniVend session database:

<P>
<PRE>    accesses           Accesses within the last 30 seconds
    arg                The argument passed in a [page ...] or [area ...] tag
    browser            The user browser string
    cybercash_error    Error from last CyberCash operation
    cybercash_result   Hash of results from CyberCash (access with usertag)
    host               MiniVend's idea of the host (modified by DomainTail)
    last_error         The last error from the error logging
    last_url           The current MiniVend path_info
    logged_in          Whether the user is logged in (add-on UserDB feature)
    pageCount          Number of unique URLs generated
    prev_url           The previous path_info
    referer            HTTP_REFERER string
    ship_message       The last error messages from shipping
    source             Source of original entry to MiniVend
    time               Time (seconds since Jan 1, 1970) of last access
    user               The REMOTE_USER string
    username           User name logged in as (UserDB feature)
</PRE>
<P>

<FONT SIZE=-1>NOTE:</FONT> Databases will hide session values, so don't
name a database ``session''. or you won't be able to use the [data ...] tag
to read them. Case is sensitive, so in a pinch you could call the database
``Session'', but it would be better not to use that name at all.

</DL>
<P>
<HR>


code: 03.14
section: TAGS
type: item
title: default

<A NAME="default">default</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>name default set</STRONG>



<P>

<FONT SIZE=-1>ONLY</FONT> 
<FONT SIZE=-1>THE</FONT> <STRONG>name default</STRONG> 
<FONT SIZE=-1>PARAMETERS</FONT> 
<FONT SIZE=-1>ARE</FONT> 
<FONT SIZE=-1>POSITIONAL.</FONT>


<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>YES</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;default(
        {
         name =&gt; VALUE,
         default =&gt; VALUE,
         set =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;default($name, $default, $set);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
Returns the value of the user form variable <CODE>variable</CODE> if it is non-empty. Otherwise returns <CODE>default</CODE>, which is the string ``default'' if there is no default supplied. Got that? This tag is 
<FONT SIZE=-1>DEPRECATED</FONT> anyway.


</DL>
<P>
<HR>


code: 03.15
section: TAGS
type: item
title: description

<A NAME="description">description</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>code base</STRONG>



<P>
Positional parameters in same order.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;description(
        {
         code =&gt; VALUE,
         base =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;description($code, $base);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
Expands into the description of the product identified by code as found in
the products database. This is the value of the database field that
corresponds to the <CODE>catalog.cfg</CODE> directive <CODE>DescriptionField</CODE>. If there is more than one products file defined, they will be searched in
order unless constrained by the optional argument <STRONG>base</STRONG>.

<P>
This tag is especially useful for multi-language catalogs. The <CODE>DescriptionField</CODE>
directive can be set for each locale and point to a different database
field; for example <CODE>desc_en</CODE> for English, <CODE>desc_fr</CODE> for French, etc.

</DL>
<P>
<HR>


code: 03.16
section: TAGS
type: item
title: discount

<A NAME="discount">discount</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>code</STRONG>



<P>
Positional parameters in same order.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
This is a container tag, i.e. [discount] 
<FONT SIZE=-1>FOO</FONT> [/discount]. Nesting: 
<FONT SIZE=-1>NO</FONT>


<P>
Invalidates cache: <STRONG>YES</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;discount(
        {
         code =&gt; VALUE,
        },
        BODY
    )
  
 OR
 
    $Tag-&gt;discount($code, $BODY);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
Product discounts can be set upon display of any page. The discounts apply
only to the customer receiving them, and are of one of three types:

<P>
<PRE>    1. A discount for one particular item code (code/key is the item-code)
    2. A discount applying to all item codes (code/key is ALL_ITEMS)
    3. A discount applied after all items are totaled
       (code/key is ENTIRE_ORDER)
</PRE>
<P>
The discounts are specified via a formula. The formula is scanned for the
variables <CODE>$q</CODE> and $s, which are substituted for with the item
<EM>quantity</EM> and <EM>subtotal</EM> respectively. In the case of the item and all items discount, the formula
must evaluate to a new subtotal for all items <EM>of that code</EM> that are ordered. The discount for the entire order is applied to the
entire order, and would normally be a monetary amount to subtract or a flat
percentage discount.

<P>
Discounts are applied to the effective price of the product, including any
quantity discounts.

<P>
To apply a straight 20% discount to all items:

<P>
<PRE>    [discount ALL_ITEMS] $s * .8 [/discount]
</PRE>
<P>
or with named attributes:

<P>
<PRE>    [discount code=ALL_ITEMS] $s * .8 [/discount]
</PRE>
<P>
To take 25% off of only item 00-342:

<P>
<PRE>    [discount 00-342] $s * .75 [/discount]
</PRE>
<P>
To subtract $5.00 from the customer's order:

<P>
<PRE>    [discount ENTIRE_ORDER] $s - 5 [/discount]
</PRE>
<P>
To reset a discount, set it to the empty string: 

<P>
<PRE>    [discount ALL_ITEMS][/discount]
</PRE>
<P>
Perl code can be used to apply the discounts. Here is an example of a
discount for item code 00-343 which prices the <EM>second</EM> one ordered at 1 cent:

<P>
<PRE>    [discount 00-343]
    return $s if $q == 1;
    my $p = $s/$q;
    my $t = ($q - 1) * $p;
    $t .= 0.01;
    return $t;
    [/discount]
</PRE>
<P>
If you want to display the discount amount, use the [item-discount] tag.

<P>
<PRE>    [item-list]
    Discount for [item-code]: [item-discount]
    [/item-list]
</PRE>
<P>
Finally, if you want to display the discounted subtotal in a way that
doesn't correspond to a standard MiniVend tag, you can use the [calc] tag:

<P>
<PRE>    [item-list]
    Discounted subtotal for [item-code]: [currency][calc]
                                            [item-price noformat] * [item-quantity]
                                            [/calc][/currency]
    [/item-list]
</PRE>
<P>
%% dump %% Prints a dump of the current user session as expanded by Data::Dumper. Includes any 
<FONT SIZE=-1>CGI</FONT> environment passed from the server.


<P>
%% either %% The C<[either]this[or]that[/either] implements a check for the first non-zero,
non-blank value. It splits on [or], and then parses each piece in turn. If
a value returns true (in the Perl sense -- non-zero, non-blank) then
subsequent pieces will be discarded without interpolation.

<P>
Example:

<P>
<PRE>  [either][value must_be_here][or][bounce href=&quot;[area incomplete]&quot;][/either]
</PRE>
</DL>
<P>
<HR>


code: 03.17
section: TAGS
type: item
title: dump

<A NAME="dump">dump</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
No parameters.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;dump(
        {
        }
    )
  
 OR
 
    $Tag-&gt;dump($);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.18
section: TAGS
type: item
title: ecml

<A NAME="ecml">ecml</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>name function</STRONG>



<P>
Positional parameters in same order.

<P>
<STRONG>The attribute hash reference is passed</STRONG> to the subroutine after the parameters as the last argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;ecml(
        {
         name =&gt; VALUE,
         function =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;ecml($name, $function, $ATTRHASH);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.19
section: TAGS
type: item
title: either

<A NAME="either">either</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
No parameters.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
This is a container tag, i.e. [either] 
<FONT SIZE=-1>FOO</FONT> [/either]. Nesting: 
<FONT SIZE=-1>NO</FONT>


<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;either(
        {
        },
        BODY
    )
  
 OR
 
    $Tag-&gt;either($BODY);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.20
section: TAGS
type: item
title: error

<A NAME="error">error</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>name</STRONG>



<P>
Positional parameters in same order.

<P>
<STRONG>The attribute hash reference is passed</STRONG> to the subroutine after the parameters as the last argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;error(
        {
         name =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;error($name, $ATTRHASH);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.21
section: TAGS
type: item
title: export

<A NAME="export">export</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>table</STRONG>



<P>
Positional parameters in same order.

<P>
<STRONG>The attribute hash reference is passed</STRONG> to the subroutine after the parameters as the last argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>YES</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;export(
        {
         table =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;export($table, $ATTRHASH);
</PRE>
<P>
Attribute aliases

<P>
<PRE>            base ==&gt; table
            database ==&gt; table
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.22
section: TAGS
type: item
title: field

<A NAME="field">field</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>name code</STRONG>



<P>
Positional parameters in same order.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;field(
        {
         name =&gt; VALUE,
         code =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;field($name, $code);
</PRE>
<P>
Attribute aliases

<P>
<PRE>            col ==&gt; name
            column ==&gt; name
            field ==&gt; name
            key ==&gt; code
            row ==&gt; code
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>

<FONT SIZE=-1>HTML</FONT> example: 
<FONT SIZE=-1>&lt;PARAM</FONT> MV=field MV.COL=column MV.ROW=key&gt;


<P>
Expands into the value of the field <EM>name</EM> for the product identified by <EM>code</EM> as found by searching the products database. It will return the first entry
found in the series of <EM>Product Files</EM>. the products database. If you want to constrain it to a particular
database, use the [data base name code] tag.

<P>
Note that if you only have one ProductFile <CODE>products</CODE>, which is the default,
<CODE>[field column key]</CODE> is the same as <CODE>[data products column key]</CODE>.

</DL>
<P>
<HR>


code: 03.23
section: TAGS
type: item
title: file

<A NAME="file">file</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>name type</STRONG>



<P>
Positional parameters in same order.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;file(
        {
         name =&gt; VALUE,
         type =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;file($name, $type);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
Inserts the contents of the named file. The file should normally be
relative to the catalog directory -- file names beginning with / or .. are
not allowed if the MiniVend server administrator has set <EM>NoAbsolute</EM> to <CODE>Yes</CODE>.

<P>
The optional <A HREF="#item_type">type</A> parameter will do an appropriate 
<FONT SIZE=-1>ASCII</FONT> translation on the file before it is sent.

</DL>
<P>
<HR>


code: 03.24
section: TAGS
type: item
title: filter

<A NAME="filter">filter</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>op</STRONG>



<P>
Positional parameters in same order.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
This is a container tag, i.e. [filter] 
<FONT SIZE=-1>FOO</FONT> [/filter]. Nesting: 
<FONT SIZE=-1>NO</FONT>


<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;filter(
        {
         op =&gt; VALUE,
        },
        BODY
    )
  
 OR
 
    $Tag-&gt;filter($op, $BODY);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
Applies any of MiniVend's standard filters to an arbitray value, or you may
define your own. The filters are also available as parameters to the <A HREF="#item_cgi">cgi</A>, <A HREF="#item_data">data</A>, and <A HREF="#item_value">value</A> tags.

<P>
Filters can be applied in sequence and as many as needed can be applied.

<P>
Here is an example. If you store your author or artist names in the database 
<FONT SIZE=-1>``LAST,</FONT> First'' so that they sort properly, you still might want to display them normally as ``First Last''. This call


<P>
<PRE>    [filter op=&quot;name namecase&quot;]WOOD, Grant[/filter]
</PRE>
<P>
will display as

<P>
<PRE>    Grant Wood
</PRE>
<P>
Another way to do this would be:

<P>
<PRE>    [data table=products column=artist key=99-102 filter=&quot;name namecase&quot;]
</PRE>
<P>
Filters available include:

<DL>
<DT><STRONG><A NAME="item_cgi">cgi</A></STRONG><DD>
<P>
Returns the value of the 
<FONT SIZE=-1>CGI</FONT> variable. Useful for starting a filter sequence
with a seed value.

<P>
<PRE>    'cgi' =&gt;    sub {
                    return $CGI::values(shift);
                },
</PRE>
<DT><STRONG><A NAME="item_digits">digits</A></STRONG><DD>
<P>
Returns only digits.

<P>
<PRE>    'digits' =&gt; sub {
                    my $val = shift;
                    $val =~ s/\D+//g;
                    return $val;
                },
</PRE>
<DT><STRONG><A NAME="item_digits_dot">digits_dot</A></STRONG><DD>
<P>
Returns only digits and periods, i.e. [.0-9]. Useful for decommifying
numbers.

<P>
<PRE>    'digits_dot' =&gt; sub {
                    my $val = shift;
                    $val =~ s/[^\d.]+//g;
                    return $val;
                },
</PRE>
<DT><STRONG><A NAME="item_dos">dos</A></STRONG><DD>
<P>
Turns linefeeds into carriage-return / linefeed pairs.

<P>
<PRE>    'dos' =&gt;    sub {
                    my $val = shift;
                    $val =~ s/\r?\n/\r\n/g;
                    return $val;
                },
</PRE>
<DT><STRONG><A NAME="item_entities">entities</A></STRONG><DD>
<P>
Changes <CODE>&lt;</CODE> to <CODE>&amp;lt;</CODE>, <CODE>&quot;</CODE> to <CODE>&amp;quot;</CODE>, etc.

<P>
<PRE>    'entities' =&gt; sub {
                    return HTML::Entities::encode(shift);
                },
</PRE>
<DT><STRONG><A NAME="item_gate">gate</A></STRONG><DD>
<P>
Performs a security screening by testing to make sure a corresponding
scratch variable has been set.

<P>
<PRE>    'gate' =&gt;   sub {
                    my ($val, $var) = @_;
                    return '' unless $::Scratch-&gt;{$var};
                    return $val;
                },
</PRE>
<DT><STRONG><A NAME="item_lc">lc</A></STRONG><DD>
<P>
Lowercases the text.

<P>
<PRE>    'lc' =&gt;     sub {
                    return lc(shift);
                },
</PRE>
<DT><STRONG><A NAME="item_lookup">lookup</A></STRONG><DD>
<P>
Looks up an item in a database based on the passed table and column. Call
would be:

<P>
<PRE>    [filter op=&quot;uc lookup.country.name&quot;]us[/filter]
</PRE>
<P>
This would be the equivalent of [data table=country column=name key=US].

<P>
<PRE>    'lookup' =&gt; sub {
                        my ($val, $tag, $table, $column) = @_;
                        return tag_data($table, $column, $val) || $val;
                },
</PRE>
<DT><STRONG><A NAME="item_mac">mac</A></STRONG><DD>
<P>
Changes newlines to carriage returns.

<P>
<PRE>    'mac' =&gt;    sub {
                    my $val = shift;
                    $val =~ s/\r?\n|\r\n?/\r/g;
                    return $val;
                },
</PRE>
<DT><STRONG>name</STRONG><DD>
<P>
Transposes a 
<FONT SIZE=-1>LAST,</FONT> First name pair.

<P>
<PRE>    'name' =&gt; sub {
                    my $val = shift;
                    return $val unless $val =~ /,/;
                    my($last, $first) = split /\s*,\s*/, $val, 2;
                    return &quot;$first $last&quot;;
                },
</PRE>
<DT><STRONG><A NAME="item_namecase">namecase</A></STRONG><DD>
<P>
Namecases the text. Only works on values that are uppercase in the first
letter, i.e. [filter op=namecase]LEONARDO da Vinci[/filter] will return
``Leonardo da Vinci''.

<P>
<PRE>    'namecase' =&gt; sub {
                    my $val = shift;
                    $val =~ s/([A-Z]\w+)/\L\u$1/g;
                    return $val;
                },
</PRE>
<DT><STRONG><A NAME="item_no_white">no_white</A></STRONG><DD>
<P>
Strips all whitespace.

<P>
<PRE>    'no_white' =&gt;   sub {
                    my $val = shift;
                    $val =~ s/\s+//g;
                    return $val;
                },
</PRE>
<DT><STRONG><A NAME="item_pagefile">pagefile</A></STRONG><DD>
<P>
Strips leading slashes and dots.

<P>
<PRE>    'pagefile' =&gt; sub {
                    $_[0] =~ s:^[./]+::;
                    return $_[0];
                },
</PRE>
<DT><STRONG><A NAME="item_sql">sql</A></STRONG><DD>
<P>
Change single-quote characters into doubled versions, i.e. ' becomes ''.

<P>
<PRE>    'sql'       =&gt; sub {
                    my $val = shift;
                    $val =~ s:':'':g; # '
                    return $val;
                },
</PRE>
<DT><STRONG><A NAME="item_strip">strip</A></STRONG><DD>
<P>
Strips leading and trailing whitespace.

<P>
<PRE>    'strip' =&gt;  sub {
                    my $val = shift;
                    $val =~ s/^\s+//;
                    $val =~ s/\s+$//;
                    return $val;
                },
</PRE>
<DT><STRONG><A NAME="item_text2html">text2html</A></STRONG><DD>
<P>
Rudimentary HTMLizing of text.

<P>
<PRE>    'text2html' =&gt; sub {
                    my $val = shift;
                    $val =~ s|\r?\n\r?\n|&lt;P&gt;|;
                    $val =~ s|\r?\n|&lt;BR&gt;|;
                    return $val;
                },
</PRE>
<DT><STRONG><A NAME="item_uc">uc</A></STRONG><DD>
<P>
Uppercases the text.

<P>
<PRE>    'uc' =&gt;     sub {
                    return uc(shift);
                },
</PRE>
<DT><STRONG><A NAME="item_unix">unix</A></STRONG><DD>
<P>
Removes those crufty carriage returns.

<P>
<PRE>    'unix' =&gt;   sub {
                    my $val = shift;
                    $val =~ s/\r?\n/\n/g;
                    return $val;
                },
</PRE>
<DT><STRONG><A NAME="item_urlencode">urlencode</A></STRONG><DD>
<P>
Changes non-word characters (except colon) to <CODE>%3c</CODE> notation.

<P>
<PRE>    'urlencode' =&gt; sub {
                    my $val = shift;
                    $val =~ s|[^\w:]|sprintf &quot;%%%02x&quot;, ord $1|eg;
                    return $val;
                },
</PRE>
<DT><STRONG><A NAME="item_value">value</A></STRONG><DD>
<P>
Returns the value of the user session variable. Useful for starting a
filter sequence with a seed value.

<P>
<PRE>    'value' =&gt;  sub {
                    return $::Values-&gt;(shift);
                },
</PRE>
<DT><STRONG><A NAME="item_word">word</A></STRONG><DD>
<P>
Only returns word characters. Locale does apply if collation is properly
set.

<P>
<PRE>    'word' =&gt;   sub {
                    my $val = shift;
                    $val =~ s/\W+//g;
                    return $val;
                },
</PRE>
<P>
You can define your own filters in an GlobalSub (or Sub or ActionMap):

<P>
<PRE>    package Vend::Interpolate;
</PRE>
<P>
<PRE>    $Filter{reverse} = sub { $val = shift; return scalar reverse $val  };
</PRE>
<P>
That filter will reverse the characters sent.

<P>
The arguments sent to the subroutine are the value to be filtered, any
associated variable or tag name, and any arguments appended to the filter
name with periods as the separator.

<P>

<FONT SIZE=-1>A</FONT> <CODE>[filter op=lookup.products.price]99-102[/filter]</CODE> will send ('99-102', undef, 'products', 'price') as the parameters.
Assuming the value of the user variable <CODE>foo</CODE> is <CODE>bar</CODE>, the call
<CODE>[value name=foo filter=&quot;lookup.products.price.extra&quot;]</CODE> will send ('bar', 'foo', 'products', 'price', 'extra').

</DL>
</DL>
<P>
<HR>


code: 03.25
section: TAGS
type: item
title: flag

<A NAME="flag">flag</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>type</STRONG>



<P>
Positional parameters in same order.

<P>
<STRONG>The attribute hash reference is passed</STRONG> to the subroutine after the parameters as the last argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>YES</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;flag(
        {
         type =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;flag($type, $ATTRHASH);
</PRE>
<P>
Attribute aliases

<P>
<PRE>            flag ==&gt; type
            name ==&gt; type
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.26
section: TAGS
type: item
title: fly_list

<A NAME="fly_list">fly_list</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>code base</STRONG>



<P>
Positional parameters in same order.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
This is a container tag, i.e. [fly_list] 
<FONT SIZE=-1>FOO</FONT> [/fly_list]. Nesting: 
<FONT SIZE=-1>NO</FONT>


<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;fly_list(
        {
         code =&gt; VALUE,
         base =&gt; VALUE,
        },
        BODY
    )
  
 OR
 
    $Tag-&gt;fly_list($code, $base, $BODY);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
Syntax: [fly-list prefix=tag_prefix* code=code*]

<P>
Defines an area in a random page which performs the flypage lookup
function, implementing the tags below.

<P>
<PRE>   [fly-list]
    (contents of flypage.html)
   [/fly-list]
</PRE>
<P>
If you place the above around the contents of the demo flypage, in a file
named <CODE>flypage2.html</CODE>, it will make these two calls display identical pages:

<P>
<PRE>    [page 00-0011] One way to display the Mona Lisa [/page]
    [page flypage2 00-0011] Another way to display the Mona Lisa [/page]
</PRE>
<P>
If you place a [fly-list] tag alone at the top of the page, it will cause
any page to act as a flypage.

<P>
By default, the prefix is <CODE>item</CODE>, meaning the <CODE>[item-code]</CODE> tag will display the code of the item, the <CODE>[item-price]</CODE> tag will display price, etc. But if you use the prefix, i.e. <CODE>[fly-list prefix=fly]</CODE>, then it will be [fly-code]; <CODE>prefix=foo</CODE> would cause <CODE>[foo-code]</CODE>, etc.

</DL>
<P>
<HR>


code: 03.27
section: TAGS
type: item
title: fly_tax

<A NAME="fly_tax">fly_tax</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>area</STRONG>



<P>
Positional parameters in same order.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;fly_tax(
        {
         area =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;fly_tax($area);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.28
section: TAGS
type: item
title: goto

<A NAME="goto">goto</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>name if</STRONG>



<P>
Positional parameters in same order.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;goto(
        {
         name =&gt; VALUE,
         if =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;goto($name, $if);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.29
section: TAGS
type: item
title: handling

<A NAME="handling">handling</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>mode</STRONG>



<P>
Positional parameters in same order.

<P>
<STRONG>The attribute hash reference is passed</STRONG> to the subroutine after the parameters as the last argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;handling(
        {
         mode =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;handling($mode, $ATTRHASH);
</PRE>
<P>
Attribute aliases

<P>
<PRE>            carts ==&gt; cart
            modes ==&gt; mode
            name ==&gt; mode
            tables ==&gt; table
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.30
section: TAGS
type: item
title: harness

<A NAME="harness">harness</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
No parameters.

<P>
<STRONG>The attribute hash reference is passed</STRONG> after the parameters but before the container text argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
This is a container tag, i.e. [harness] 
<FONT SIZE=-1>FOO</FONT> [/harness]. Nesting: 
<FONT SIZE=-1>NO</FONT>


<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;harness(
        {
        },
        BODY
    )
  
 OR
 
    $Tag-&gt;harness($ATTRHASH, $BODY);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.31
section: TAGS
type: item
title: html_table

<A NAME="html_table">html_table</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
No parameters.

<P>
<STRONG>The attribute hash reference is passed</STRONG> after the parameters but before the container text argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
This is a container tag, i.e. [html_table] 
<FONT SIZE=-1>FOO</FONT> [/html_table]. Nesting: 
<FONT SIZE=-1>NO</FONT>


<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;html_table(
        {
        },
        BODY
    )
  
 OR
 
    $Tag-&gt;html_table($ATTRHASH, $BODY);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.32
section: TAGS
type: item
title: if

<A NAME="if">if</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>type term op compare</STRONG>



<P>

<FONT SIZE=-1>THIS</FONT> 
<FONT SIZE=-1>TAG</FONT> 
<FONT SIZE=-1>HAS</FONT> 
<FONT SIZE=-1>SPECIAL</FONT> 
<FONT SIZE=-1>POSITIONAL</FONT> 
<FONT SIZE=-1>PARAMETER</FONT> 
<FONT SIZE=-1>HANDLING.</FONT>


<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
This is a container tag, i.e. [if] 
<FONT SIZE=-1>FOO</FONT> [/if]. Nesting: 
<FONT SIZE=-1>NO</FONT>


<P>
Invalidates cache: <STRONG>YES</STRONG>



<P>
Called Routine: 

<P>
Called Routine for positonal: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;if(
        {
         type =&gt; VALUE,
         term =&gt; VALUE,
         op =&gt; VALUE,
         compare =&gt; VALUE,
        },
        BODY
    )
  
 OR
 
    $Tag-&gt;if($type, $term, $op, $compare, $BODY);
</PRE>
<P>
Attribute aliases

<P>
<PRE>            base ==&gt; type
            comp ==&gt; compare
            condition ==&gt; compare
            operator ==&gt; op
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
Named call example: [if type=``type'' term=``field'' op=``op''
compare=``compare'']

<P>
Positional call example: [if type field op compare]

<P>
negated: [if type=``!type'' term=``field'' op=``op'' compare=``compare'']

<P>
Positional call example: [if !type field op compare]

<P>
Allows conditional building of 
<FONT SIZE=-1>HTML</FONT> based on the setting of various MiniVend session
and database values. The general form is:

<P>
<PRE>    [if type term op compare]
    [then]
                                If true, this is printed on the document.
                                The [then] [/then] is optional in most
                                cases. If ! is prepended to the type
                                setting, the sense is reversed and
                                this will be output for a false condition.
    [/then]
    [elsif type term op compare]
                                Optional, tested when if fails
    [/elsif] 
    [else]
                                Optional, printed when all above fail
    [/else]
    [/if]
</PRE>
<P>
The <CODE>[if]</CODE> tag can also have some variants:

<P>
<PRE>    [if type=explicit compare=`$perl_code`]
        Displayed if valid Perl CODE returns a true value.
    [/if]
</PRE>
<P>
You can do some Perl-style regular expressions:

<P>
<PRE>    [if value name =~ /^mike/]
                                This is the if with Mike.
    [elsif value name =~ /^sally/]
                                This is an elsif with Sally.
    [/elsif]
    [elsif value name =~ /^pat/]
                                This is an elsif with Pat.
    [/elsif]
    [else]
                                This is the else, no name I know.
    [/else]
    [/if]
</PRE>
<P>
While named parameter tag syntax works for <CODE>[if ...]</CODE>, it is more convenient to use positional calls in most cases. The only
exception is if you are planning on doing a test on the results of another
tag sequence: [if value name =~ /[value b_name]/] Shipping name matches
billing name. [/if]

<P>
Oops! This will not work. You must do instead

<P>
<PRE>    [if base=value field=name op=&quot;=~&quot; compare=&quot;/[value b_name]/&quot;]
        Shipping name matches billing name.
    [/if]
</PRE>
<P>
or better yet

<P>
<PRE>    [if type=explicit compare=`
                        $Value-&gt;{name} =~ /$Value-&gt;{b_name}/
                        `]
        Shipping name matches billing name.
    [/if]
</PRE>
<P>
MiniVend also supports a limited [and ...] and [or ...] capability:

<P>
<PRE>    [if value name =~ /Mike/]
    [or value name =~ /Jean/]
    Your name is Mike or Jean.
    [/if]
</PRE>
<P>
<PRE>    [if value name =~ /Mike/]
    [and value state =~ /OH/]
    Your name is Mike and you live in Ohio.
    [/if]
</PRE>
<P>
If you wish to do very complex 
<FONT SIZE=-1>AND</FONT> and 
<FONT SIZE=-1>OR</FONT> operations, you will have to use
 
<CODE>[if explicit]</CODE> or better yet embedded Perl/ASP. This allows complex testing and parsing of
values.

<P>
There are many test targets available:

<DL>
<DT><STRONG><A NAME="item_config">config Directive</A></STRONG><DD>
<P>
The MiniVend configuration variables. These are set by the directives in
your MiniVend configuration file (or the defaults).

<P>
<PRE>    [if config CreditCardAuto]
    Auto credit card validation is enabled.
    [/if]
</PRE>
<DT><STRONG><A NAME="item_data">data  database::field::key</A></STRONG><DD>
<P>
The MiniVend databases. Retrieves a field in the database and returns true
or false based on the value.

<P>
<PRE>    [if data products::size::99-102]
    There is size information.
    [else]
    No size information.
    [/else]
    [/if]
</PRE>
<P>
<PRE>    [if data products::size::99-102 =~ /small/i]
    There is a small size available.
    [else]
    No small size available.
    [/else]
    [/if]
</PRE>
<DT><STRONG><A NAME="item_discount">discount</A></STRONG><DD>
<P>
Checks to see if a discount is present for an item.

<P>
<PRE>    [if discount 99-102]
    Item is discounted.
    [/if]
</PRE>
<DT><STRONG><A NAME="item_explicit">explicit</A></STRONG><DD>
<P>

<FONT SIZE=-1>A</FONT> test for an explicit value. If perl code is placed
between a [condition] [/condition] tag pair, it will be used to make the
comparison. Arguments can be passed to import data from user space, just as
with the [perl] tag.

<P>
<PRE>    [if explicit]
    [condition]
        $country = '[value country]';
        return 1 if $country =~ /u\.?s\.?a?/i;
        return 0;
    [/condition]
    You have indicated a US address.
    [else]
    You have indicated a non-US address. 
    [/else]
    [/if]
</PRE>
<P>
This example is a bit contrived, as the same thing could be accomplished
with [if value country =~ /u\.?s\.?a?/i], but you will run into many
situations where it is useful.

<P>
This will work for <EM>Variable</EM> values:

<P>
<PRE>    [if type=explicit compare=&quot;__MYVAR__&quot;] .. [/if]
</PRE>
<DT><STRONG><A NAME="item_file">file</A></STRONG><DD>
<P>
Tests for existence of a file. Useful for placing image tags only if the
image is present.

<P>
<PRE>    [if file /home/user/www/images/[item-code].gif]
    &lt;IMG SRC=&quot;[item-code].gif&quot;&gt;
    [/if]
</PRE>
<P>
The <A HREF="#item_file">file</A> test requires that the <EM>SafeUntrap</EM> directive contains
<CODE>ftfile</CODE> (which is the default).

<DT><STRONG><A NAME="item_items">items</A></STRONG><DD>
<P>
The MiniVend shopping carts. If not specified, the cart used is the main
cart. Usually used as a litmus test to see if anything is in the cart, for
example:

<P>
<PRE>  [if items]You have items in your shopping cart.[/if]
  
  [if items layaway]You have items on layaway.[/if]
</PRE>
<DT><STRONG><A NAME="item_ordered">ordered</A></STRONG><DD>
<P>
Order status of individual items in the MiniVend shopping carts. If not
specified, the cart used is the main cart. The following items refer to a
part number of 99-102.

<P>
<PRE>  [if ordered 99-102] Item 99-102 is in your cart. [/if]
    Checks the status of an item on order, true if item
    99-102 is in the main cart.
</PRE>
<P>
<PRE>  [if ordered 99-102 layaway] ... [/if]
    Checks the status of an item on order, true if item
    99-102 is in the layaway cart.
</PRE>
<P>
<PRE>  [if ordered 99-102 main size] ... [/if]
    Checks the status of an item on order in the main cart,
    true if it has a size attribute.
</PRE>
<P>
<PRE>  [if ordered 99-102 main size =~ /large/i] ... [/if]
    Checks the status of an item on order in the main cart,
    true if it has a size attribute containing 'large'.
</PRE>
<P>
<PRE>    To make sure it is exactly large, you could use:
</PRE>
<P>
<PRE>  [if ordered 99-102 main size eq 'large'] ... [/if]
</PRE>
<DT><STRONG><A NAME="item_scratch">scratch</A></STRONG><DD>
<P>
The MiniVend scratchpad variables, which can be set with the [set
name]value[/set] element. 

<P>
<PRE>    [if scratch mv_separate_items]
    ordered items will be placed on a separate line.
    [else]
    ordered items will be placed on the same line.
    [/else]
    [/if]
</PRE>
<DT><STRONG><A NAME="item_session">session</A></STRONG><DD>
<P>
the minivend session variables. of particular interest are i&lt;login&gt;,
i&lt;frames&gt;, i&lt;secure&gt;, and i&lt;browser&gt;.

<DT><STRONG><A NAME="item_validcc">validcc</A></STRONG><DD>
<P>
a special case, takes the form [if validcc no type exp_date]. evaluates to
true if the supplied credit card number, type of card, and expiration date
pass a validity test. does a luhn-10 calculation to weed out typos or phony
card numbers. Uses the standard <CODE>CreditCardAuto</CODE> variables for targets if nothing else is passed.

<DT><STRONG>value</STRONG><DD>
<P>
the minivend user variables, typically set in search, control, or order
forms. variables beginning with c&lt;mv_&gt; are minivend special values,
and should be tested/used with caution.

</DL>
<P>
The <EM>field</EM> term is the specifier for that area. For example, [if session logged_in]
would return true if the <CODE>logged_in</CODE> session parameter was set.

<P>
As an example, consider buttonbars for frame-based setups. It would be nice
to display a different buttonbar (with no frame targets) for sessions that
are not using frames:

<P>
<PRE>    [if scratch frames]
        __BUTTONBAR_FRAMES__
    [else]
        __BUTTONBAR__
    [/else]
    [/if]
</PRE>
<P>
Another example might be the when search matches are displayed. If you use
the string '[value mv_match_count] titles found', it will display a plural
for only one match. Use:

<P>
<PRE>    [if value mv_match_count != 1]
        [value mv_match_count] matches found.
    [else]
        Only one match was found.
    [/else]
    [/if]
</PRE>
<P>
The <EM>op</EM> term is the compare operation to be used. Compare operations are as in
Perl:

<P>
<PRE>    ==  numeric equivalence
    eq  string equivalence
    &gt;   numeric greater-than
    gt  string greater-than
    &lt;   numeric less-than
    lt  string less-than
    !=  numeric non-equivalence
    ne  string equivalence
</PRE>
<P>
Any simple perl test can be used, including some limited regex matching.
More complex tests are best done with <CODE>[if explicit]</CODE>.

<DL>
<DT><STRONG><A NAME="item__then_">[then] text [/then]</A></STRONG><DD>
<P>
This is optional if you are not nesting if conditions, as the text
immediately following the [if ..] tag is used as the conditionally
substituted text. If nesting [if ...] tags you should use a [then][/then]
on any outside conditions to ensure proper interpolation.

<DT><STRONG><A NAME="item__elsif">[elsif type field op* compare*]</A></STRONG><DD>
<P>
named attributes: [elsif type=``type'' term=``field'' op=``op''
compare=``compare'']

<P>
Additional conditions for test, applied if the initial <CODE>[if ..]</CODE> test fails.

<DT><STRONG><A NAME="item__else_">[else] text [/else]</A></STRONG><DD>
<P>
The optional else-text for an if or if_field conditional.

<DT><STRONG><A NAME="item__condition_">[condition] text [/condition]</A></STRONG><DD>
<P>
Only used with the [if explicit] tag. Allows an arbitrary expression
<STRONG>in Perl</STRONG> to be placed inside, with its return value interpreted as the result of the
test. If arguments are added to [if explicit args], those will be passed as
arguments are in the <EM>[perl]</EM> construct.

</DL>
</DL>
<P>
<HR>


code: 03.33
section: TAGS
type: item
title: import

<A NAME="import">import</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>table type</STRONG>



<P>
Positional parameters in same order.

<P>
<STRONG>The attribute hash reference is passed</STRONG> after the parameters but before the container text argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Interpolates <STRONG>container text</STRONG> by default&gt;.

<P>
This is a container tag, i.e. [import] 
<FONT SIZE=-1>FOO</FONT> [/import]. Nesting: 
<FONT SIZE=-1>NO</FONT>


<P>
Invalidates cache: <STRONG>YES</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;import(
        {
         table =&gt; VALUE,
         type =&gt; VALUE,
        },
        BODY
    )
  
 OR
 
    $Tag-&gt;import($table, $type, $ATTRHASH, $BODY);
</PRE>
<P>
Attribute aliases

<P>
<PRE>            base ==&gt; table
            database ==&gt; table
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
Named attributes:

<P>
<PRE>    [import table=table_name
            type=(TAB|PIPE|CSV|%%|LINE)
            continue=(NOTES|UNIX|DITTO)
            separator=c]
</PRE>
<P>
Import one or more records into a database. The <A HREF="#item_type">type</A> is any of the valid MiniVend delimiter types, with the default being
defined by the setting of the database <EM>DELIMITER</EM>. The table must already be a defined MiniVend database table; it cannot be created on the fly. (If you need that, it is time to use 
<FONT SIZE=-1>SQL.)</FONT>


<P>
The <A HREF="#item_type">type</A> of <CODE>LINE</CODE> and <CODE>continue</CODE> setting of <CODE>NOTES</CODE> is particularly useful, for it allows you to name your fields and not have
to remember the order in which they appear in the database. The following
two imports are identical in effect:

<P>
<PRE>    [import table=orders]
    code: [value mv_order_number]
    shipping_mode: [shipping-description]
    status: pending
    [/import]
  
    [import table=orders]
    shipping_mode: [shipping-description]
    status: pending
    code: [value mv_order_number]
    [/import]
</PRE>
<P>
The <A HREF="#item_code">code</A> or key must always be present, and is always named <A HREF="#item_code">code</A>.

<P>
If you do not use <CODE>NOTES</CODE> mode, you must import the fields in the same order as they appear in the 
<FONT SIZE=-1>ASCII</FONT> source file.

<P>
The <CODE>[import ....] TEXT [/import]</CODE> region may contain multiple records. If using <CODE>NOTES</CODE> mode, you must use a separator, which by default is a form-feed character 
<FONT SIZE=-1>(^L).</FONT>

</DL>
<P>
<HR>


code: 03.34
section: TAGS
type: item
title: include

<A NAME="include">include</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>file</STRONG>



<P>
Positional parameters in same order.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;include(
        {
         file =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;include($file);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
Same as <CODE>[file name]</CODE> except interpolates for all MiniVend tags and variables. Does 
<FONT SIZE=-1>NOT</FONT> do locale translations.

</DL>
<P>
<HR>


code: 03.35
section: TAGS
type: item
title: index

<A NAME="index">index</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>table</STRONG>



<P>
Positional parameters in same order.

<P>
<STRONG>The attribute hash reference is passed</STRONG> to the subroutine after the parameters as the last argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>YES</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;index(
        {
         table =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;index($table, $ATTRHASH);
</PRE>
<P>
Attribute aliases

<P>
<PRE>            base ==&gt; table
            database ==&gt; table
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.36
section: TAGS
type: item
title: input_filter

<A NAME="input_filter">input_filter</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>name</STRONG>



<P>
Positional parameters in same order.

<P>
<STRONG>The attribute hash reference is passed</STRONG> after the parameters but before the container text argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
This is a container tag, i.e. [input_filter] 
<FONT SIZE=-1>FOO</FONT> [/input_filter]. Nesting: 
<FONT SIZE=-1>NO</FONT>


<P>
Invalidates cache: <STRONG>YES</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;input_filter(
        {
         name =&gt; VALUE,
        },
        BODY
    )
  
 OR
 
    $Tag-&gt;input_filter($name, $ATTRHASH, $BODY);
</PRE>
<P>
Attribute aliases

<P>
<PRE>            ops ==&gt; op
            var ==&gt; name
            variable ==&gt; name
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.37
section: TAGS
type: item
title: item_list

<A NAME="item_list">item_list</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>name</STRONG>



<P>

<FONT SIZE=-1>ONLY</FONT> 
<FONT SIZE=-1>THE</FONT> <STRONG></STRONG> 
<FONT SIZE=-1>PARAMETERS</FONT> 
<FONT SIZE=-1>ARE</FONT> 
<FONT SIZE=-1>POSITIONAL.</FONT>


<P>
<STRONG>The attribute hash reference is passed</STRONG> after the parameters but before the container text argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
This is a container tag, i.e. [item_list] 
<FONT SIZE=-1>FOO</FONT> [/item_list]. Nesting: 
<FONT SIZE=-1>NO</FONT>


<P>
Invalidates cache: <STRONG>YES</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;item_list(
        {
         name =&gt; VALUE,
        },
        BODY
    )
  
 OR
 
    $Tag-&gt;item_list($name, $ATTRHASH, $BODY);
</PRE>
<P>
Attribute aliases

<P>
<PRE>            cart ==&gt; name
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
Within any page, the [item_list cart*] element shows a list of all the
items ordered by the customer so far. It works by repeating the source
between [item_list] and [/item_list] once for each item ordered.

<P>

<FONT SIZE=-1>NOTE:</FONT> The special tags that reference item within the list are not normal MiniVend tags, do not take named attributes, and cannot be contained in an 
<FONT SIZE=-1>HTML</FONT> tag (other than to substitute for one of its values or provide a conditional container). They are interpreted only inside their corresponding list container. Normal MiniVend tags can be interspersed, though they will be interpreted
 <EM>after</EM> all of the list-specific tags.

<P>
Between the item_list markers the following elements will return
information for the current item:

<DL>
<DT><STRONG><A NAME="item__if_data">[if-data table column]</A></STRONG><DD>
<P>
If the database field <A HREF="#item_column">column</A> in table <EM>table</EM> is non-blank, the following text up to the [/if_data] tag is substituted. This can be used to substitute 
<FONT SIZE=-1>IMG</FONT> or other tags only if the corresponding source item is present. Also accepts a [else]else text[/else] pair for the opposite condition.


<DT><STRONG>[if-data ! table column]</STRONG><DD>
<P>
Reverses sense for [if-data].

<DT><STRONG><A NAME="item__if_data_">[/if-data]</A></STRONG><DD>
<P>
Terminates an [if_data table column] element.

<DT><STRONG><A NAME="item__if_field">[if-field fieldname]</A></STRONG><DD>
<P>
If the products database field <EM>fieldname</EM> is non-blank, the following text up to the [/if_field] tag is substituted.
If you have more than one products database table (see <EM>ProductFiles</EM>), it will check them in order until a matching key is found. This can be used to substitute 
<FONT SIZE=-1>IMG</FONT> or other tags only if the corresponding source item is present. Also accepts a [else]else text[/else] pair for the opposite condition.


<DT><STRONG>[if-field ! fieldname]</STRONG><DD>
<P>
Reverses sense for [if-field].

<DT><STRONG><A NAME="item__if_field_">[/if-field]</A></STRONG><DD>
<P>
Terminates an [if_field fieldname] element.

<DT><STRONG><A NAME="item__item_accessories">[item-accessories attribute*, type*, field*, database*, name*]</A></STRONG><DD>
<P>
Evaluates to the value of the Accessories database entry for the item. If
passed any of the optional arguments, initiates special processing of item
attributes based on entries in the product database.

<DT><STRONG><A NAME="item__item_code_">[item-code]</A></STRONG><DD>
<P>
Evaluates to the product code for the current item.

<DT><STRONG><A NAME="item__item_data">[item-data database fieldname]</A></STRONG><DD>
<P>
Evaluates to the field name <EM>fieldname</EM> in the arbitrary database table <EM>database</EM>, for the current item.

<DT><STRONG><A NAME="item__item_description_">[item-description]</A></STRONG><DD>
<P>
Evaluates to the product description (from the products file) for the
current item.

<P>
In support of <CODE>OnFly</CODE>, if the description field is not found in the database, the <CODE>description</CODE> setting in the shopping cart will be used instead.

<DT><STRONG><A NAME="item__item_field">[item-field fieldname]</A></STRONG><DD>
<P>
Evaluates to the field name <EM>fieldname</EM> in the products database, for the current item. If the item is not found in
the first of the
<EM>ProductFiles</EM>, all will be searched in sequence.

<DT><STRONG><A NAME="item__item_increment_">[item-increment]</A></STRONG><DD>
<P>
Evaluates to the number of the item in the match list. Used for numbering
search matches or order items in the list.

<DT><STRONG><A NAME="item__item_last_tags_item_last_">[item-last]tags[/item-last]</A></STRONG><DD>
<P>
Evaluates the output of the MiniVend tags encased inside the tags, and if
it evaluates to a numerical non-zero number (i.e. 1, 23, or -1) then the
list iteration will terminate. If the evaluated number is
<STRONG>negative</STRONG>, then the item itself will be skipped. If the evaluated number is <STRONG>positive</STRONG>, then the item itself will be shown but will be last on the list.

<P>
<PRE>      [item-last][calc]
        return -1 if '[item-field weight]' eq '';
        return 1 if '[item-field weight]' &lt; 1;
        return 0;
        [/calc][/item-last]
</PRE>
<P>
If this is contained in your <CODE>[item-list]</CODE> (or <CODE>[search-list]</CODE> or flypage) and the weight field is empty, then a numerical <CODE>-1</CODE> will be output from the [calc][/calc] tags; the list will end and the item
will <STRONG>not</STRONG> be shown. If the product's weight field is less than 1, a numerical 1 is
output. The item will be shown, but will be the last item shown. (If it is
an <CODE>[item-list]</CODE>, any price for the item will still be added to the subtotal.) 
<FONT SIZE=-1>NOTE:</FONT> no 
<FONT SIZE=-1>HTML</FONT> style.


<DT><STRONG><A NAME="item__item_modifier">[item-modifier attribute]</A></STRONG><DD>
<P>
Evaluates to the modifier value of <CODE>attribute</CODE> for the current item.

<DT><STRONG><A NAME="item__item_next_tags_item_next_">[item-next]tags[/item_next]</A></STRONG><DD>
<P>
Evaluates the output of the MiniVend tags encased inside, and if it
evaluates to a numerical non-zero number (i.e. 1, 23, or -1) then the item
will be skipped with no output. Example:

<P>
<PRE>      [item-next][calc][item-field weight] &lt; 1[/calc][/item-next]
</PRE>
<P>
If this is contained in your <CODE>[item-list]</CODE> (or <CODE>[search-list]</CODE> or flypage) and the product's weight field is less than 1, then a numerical <CODE>1</CODE> will be output from the [calc][/calc] operation. The item will not be
shown. (If it is an <CODE>[item-list]</CODE>, any price for the item will still be added to the subtotal.)

<DT><STRONG><A NAME="item__item_price">[item-price n* noformat*]</A></STRONG><DD>
<P>
Evaluates to the price for quantity <CODE>n</CODE> (from the products file) of the current item, with currency formatting. If
the optional ``noformat'' is set, then currency formatting will not be
applied.

<DT><STRONG><A NAME="item__discount_price">[discount-price n* noformat*]</A></STRONG><DD>
<P>
Evaluates to the discount price for quantity <CODE>n</CODE> (from the products file) of the current item, with currency formatting. If
the optional ``noformat'' is set, then currency formatting will not be
applied. Returns regular price if not discounted.

<DT><STRONG><A NAME="item__item_discount_">[item-discount]</A></STRONG><DD>
<P>
Returns the difference between the regular price and the discounted price.

<DT><STRONG><A NAME="item__item_quantity_">[item-quantity]</A></STRONG><DD>
<P>
Evaluates to the quantity ordered for the current item.

<DT><STRONG><A NAME="item__item_subtotal_">[item-subtotal]</A></STRONG><DD>
<P>
Evaluates to the subtotal (quantity * price) for the current item. Quantity
price breaks are taken into account.

<DT><STRONG>[modifier-name attribute]</STRONG><DD>
<P>
Evaluates to the name to give an input box in which the customer can
specify the modifier to the ordered item.

<DT><STRONG>[quantity-name]</STRONG><DD>
<P>
Evaluates to the name to give an input box in which the customer can enter
the quantity to order.

</DL>
</DL>
<P>
<HR>


code: 03.38
section: TAGS
type: item
title: label

<A NAME="label">label</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>name</STRONG>



<P>
Positional parameters in same order.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;label(
        {
         name =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;label($name);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.39
section: TAGS
type: item
title: loop

<A NAME="loop">loop</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>list</STRONG>



<P>
Positional parameters in same order.

<P>
<STRONG>The attribute hash reference is passed</STRONG> after the parameters but before the container text argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
This is a container tag, i.e. [loop] 
<FONT SIZE=-1>FOO</FONT> [/loop]. Nesting: 
<FONT SIZE=-1>NO</FONT>


<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;loop(
        {
         list =&gt; VALUE,
        },
        BODY
    )
  
 OR
 
    $Tag-&gt;loop($list, $ATTRHASH, $BODY);
</PRE>
<P>
Attribute aliases

<P>
<PRE>            arg ==&gt; list
            args ==&gt; list
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>

<FONT SIZE=-1>HTML</FONT> example: 

<P>
<PRE>    &lt;TABLE&gt;&lt;TR MV=&quot;loop 1 2 3&quot;&gt;&lt;TD&gt;[loop-code]&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;
</PRE>
<P>
Returns a string consisting of the 
<FONT SIZE=-1>LIST,</FONT> repeated for every item in a comma-separated or
space-separated list. Operates in the same fashion as the [item-list] tag,
except for order-item-specific values. Intended to pull multiple attributes
from an item modifier -- but can be useful for other things, like building
a pre-ordained product list on a page.

<P>
Loop lists can be nested reliably in MiniVend 3.06 by using the
with=``tag'' parameter. New syntax:

<P>
<PRE>    [loop arg=&quot;A B C&quot;]
        [loop with=&quot;-a&quot; arg=&quot;[loop-code]1 [loop-code]2 [loop-code]3&quot;]
            [loop with=&quot;-b&quot; arg=&quot;X Y Z&quot;]
                [loop-code-a]-[loop-code-b]
            [/loop]
        [/loop]
    [/loop]
</PRE>
<P>
An example in the old syntax:

<P>
<PRE>    [compat]
    [loop 1 2 3]   
        [loop-a 1 2 3 ]
        [loop-b 1 2 3]
            [loop-code].[loop-code-a].[loop-code-b]
        [/loop-b]
        [/loop-a]
    [/loop]
    [/compat]
</PRE>
<P>
All loop items in the inner loop-a loop need to have the <CODE>with</CODE> value appended, i.e. <CODE>[loop-field-a name]</CODE>, <CODE>[loop-price-a]</CODE>, etc. Nesting is arbitrarily large, though it will be slow for many
levels.

<P>
You can do an arbitrary search with the search=``args'' parameter, just as
in a one-click search:

<P>
<PRE>    [loop search=&quot;se=Americana/sf=category&quot;]
        [loop-code] [loop-field title]
    [/loop]
</PRE>
<P>
The above will show all items with a category containing the whole world
``Americana'', and will work the same in both old and new syntax.

<DL>
<DT><STRONG><A NAME="item__if_loop_data">[if-loop-data table field] IF [else] ELSE [/else][/if-loop-field]</A></STRONG><DD>
<P>
Outputs the 
<FONT SIZE=-1>IF</FONT> if the <CODE>field</CODE> in <A HREF="#item_table">table</A> is non-empty, and the 
<FONT SIZE=-1>ELSE</FONT> (if any) otherwise.

<DT><STRONG><A NAME="item__if_loop_field">[if-loop-field field] IF [else] ELSE [/else][/if-loop-field]</A></STRONG><DD>
<P>
Outputs the <STRONG>IF</STRONG> if the <CODE>field</CODE> in the <CODE>products</CODE> table is non-empty, and the <STRONG>ELSE</STRONG> (if any) otherwise.

<DT><STRONG><A NAME="item__loop_accessories_">[loop-accessories]</A></STRONG><DD>
<P>
Evaluates to the value of the Accessories database entry for the item.

<DT><STRONG><A NAME="item__loop_change">[loop-change marker]</A></STRONG><DD>
<P>
Same as <EM>[on_change]</EM> but within loop lists.

<DT><STRONG><A NAME="item__loop_code_">[loop-code]</A></STRONG><DD>
<P>
Evaluates to the product code for the current item.

<DT><STRONG><A NAME="item__loop_data">[loop-data database fieldname]</A></STRONG><DD>
<P>
Evaluates to the field name <EM>fieldname</EM> in the arbitrary database table <EM>database</EM>, for the current item.

<DT><STRONG><A NAME="item__loop_description_">[loop-description]</A></STRONG><DD>
<P>
Evaluates to the product description (from the products file) for the
current item.

<DT><STRONG><A NAME="item__loop_field">[loop-field fieldname]</A></STRONG><DD>
<P>
Evaluates to the field name <EM>fieldname</EM> in the database, for the current item.

<DT><STRONG><A NAME="item__loop_increment_">[loop-increment]</A></STRONG><DD>
<P>
Evaluates to the number of the item in the list. Used for numbering items
in the list.

<DT><STRONG><A NAME="item__loop_last_tags_loop_last_">[loop-last]tags[/loop-last]</A></STRONG><DD>
<P>
Evaluates the output of the MiniVend tags encased inside, and if it
evaluates to a numerical non-zero number (i.e. 1, 23, or -1) then the loop
iteration will terminate. If the evaluated number is
<STRONG>negative</STRONG>, then the item itself will be skipped. If the evaluated number is <STRONG>positive</STRONG>, then the item itself will be shown but will be last on the list.

<P>
<PRE>      [loop-last][calc]
        return -1 if '[loop-field weight]' eq '';
        return 1 if '[loop-field weight]' &lt; 1;
        return 0;
        [/calc][/loop-last]
</PRE>
<P>
If this is contained in your <CODE>[loop list]</CODE> and the weight field is empty, then a numerical <CODE>-1</CODE> will be output from the [calc][/calc] tags; the list will end and the item
will <STRONG>not</STRONG> be shown. If the product's weight field is less than 1, a numerical 1 is
output. The item will be shown, but will be the last item shown.

<DT><STRONG><A NAME="item__loop_next_tags_loop_next_">[loop-next]tags[/loop-next]</A></STRONG><DD>
<P>
Evaluates the output of the MiniVend tags encased inside, and if it
evaluates to a numerical non-zero number (i.e. 1, 23, or -1) then the loop
will be skipped with no output. Example:

<P>
<PRE>      [loop-next][calc][loop-field weight] &lt; 1[/calc][/loop-next]
</PRE>
<P>
If this is contained in your <CODE>[loop list]</CODE> and the product's weight field is less than 1, then a numerical <CODE>1</CODE> will be output from the [calc][/calc] operation. The item will not be
shown.

<DT><STRONG><A NAME="item__loop_price">[loop-price n* noformat*]</A></STRONG><DD>
<P>
Evaluates to the price for optional quantity n (from the products file) of
the current item, with currency formatting. If the optional ``noformat'' is
set, then currency formatting will not be applied.

</DL>
</DL>
<P>
<HR>


code: 03.40
section: TAGS
type: item
title: mvasp

<A NAME="mvasp">mvasp</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>tables</STRONG>



<P>
Positional parameters in same order.

<P>
<STRONG>The attribute hash reference is passed</STRONG> after the parameters but before the container text argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
This is a container tag, i.e. [mvasp] 
<FONT SIZE=-1>FOO</FONT> [/mvasp]. Nesting: 
<FONT SIZE=-1>NO</FONT>


<P>
Invalidates cache: <STRONG>YES</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;mvasp(
        {
         tables =&gt; VALUE,
        },
        BODY
    )
  
 OR
 
    $Tag-&gt;mvasp($tables, $ATTRHASH, $BODY);
</PRE>
<P>
Attribute aliases

<P>
<PRE>            table ==&gt; tables
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.41
section: TAGS
type: item
title: nitems

<A NAME="nitems">nitems</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>name</STRONG>



<P>
Positional parameters in same order.

<P>
<STRONG>The attribute hash reference is passed</STRONG> to the subroutine after the parameters as the last argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>YES</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;nitems(
        {
         name =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;nitems($name, $ATTRHASH);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
Expands into the total number of items ordered so far. Takes an optional
cart name as a parameter.

</DL>
<P>
<HR>


code: 03.42
section: TAGS
type: item
title: onfly

<A NAME="onfly">onfly</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>code quantity</STRONG>



<P>
Positional parameters in same order.

<P>
<STRONG>The attribute hash reference is passed</STRONG> to the subroutine after the parameters as the last argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;onfly(
        {
         code =&gt; VALUE,
         quantity =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;onfly($code, $quantity, $ATTRHASH);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.43
section: TAGS
type: item
title: or

<A NAME="or">or</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>type term op compare</STRONG>



<P>

<FONT SIZE=-1>THIS</FONT> 
<FONT SIZE=-1>TAG</FONT> 
<FONT SIZE=-1>HAS</FONT> 
<FONT SIZE=-1>SPECIAL</FONT> 
<FONT SIZE=-1>POSITIONAL</FONT> 
<FONT SIZE=-1>PARAMETER</FONT> 
<FONT SIZE=-1>HANDLING.</FONT>


<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
Called Routine for positonal: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;or(
        {
         type =&gt; VALUE,
         term =&gt; VALUE,
         op =&gt; VALUE,
         compare =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;or($type, $term, $op, $compare);
</PRE>
<P>
Attribute aliases

<P>
<PRE>            base ==&gt; type
            comp ==&gt; compare
            operator ==&gt; op
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.44
section: TAGS
type: item
title: order

<A NAME="order">order</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>code quantity</STRONG>



<P>
Positional parameters in same order.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;order(
        {
         code =&gt; VALUE,
         quantity =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;order($code, $quantity);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
Expands into a hypertext link which will include the specified code in the
list of products to order and display the order page. <STRONG>code</STRONG>
should be a product code listed in one of the ``products'' databases. The
optional argument <STRONG>cart/page</STRONG> selects the shopping cart the item will be placed in (begin with / to use
the default cart <CODE>main</CODE>) and the order page that will display the order. The optional argument <STRONG>database</STRONG> constrains the order to a particular products file -- if not specified, all
databases defined as products files will be searched in sequence for the
item.

<P>
Example: 

<P>
<PRE>  Order a [order TK112]Toaster[/order] today.
</PRE>
</DL>
<P>
<HR>


code: 03.45
section: TAGS
type: item
title: page

<A NAME="page">page</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Aliases for tag

<P>
a

<P>
Parameters: <STRONG>href arg</STRONG>



<P>
Positional parameters in same order.

<P>
<STRONG>The attribute hash reference is passed</STRONG> to the subroutine after the parameters as the last argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;page(
        {
         href =&gt; VALUE,
         arg =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;page($href, $arg, $ATTRHASH);
</PRE>
<P>
Attribute aliases

<P>
<PRE>            base ==&gt; arg
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
Insert a hyperlink to the specified catalog page pg. For example, [page
shirts] will expand into &lt; a
href=``http://machine.company.com/cgi-bin/vlink/shirts?WehUkATn;;1''&gt;.
The catalog page displayed will come from ``shirts.html'' in the pages
directory.

<P>
The additional argument will be passed to MiniVend and placed in the {arg}
session parameter. This allows programming of a conditional page display
based on where the link came from. The argument is then available with the
tag [data session arg], or the embedded Perl session variable
$Session-&gt;{arg}. Spaces and some other characters will be escaped with
the <CODE>%NN</CODE> HTTP-style notation and unescaped when the argument is
read back into the session.

<P>

<FONT SIZE=-1>A</FONT> bit of magic occurs if MiniVend has built a static plain 
<FONT SIZE=-1>HTML</FONT> page for the target page. Instead of generating a normal MiniVend-parsed page reference, a static page reference will be inserted if the user has accepted and sent back a cookie with the session 
<FONT SIZE=-1>ID.</FONT>


<P>
The optional <CODE>form</CODE> argument allows you to encode a form in the link.

<P>
<PRE>        [page form=&quot;
                mv_order_item=99-102
                mv_order_size=L
                mv_order_quantity=1
                mv_separate_items=1
                mv_todo=refresh&quot;] Order t-shirt in Large size &lt;/A&gt;
</PRE>
<P>
The two form values <EM>mv_session_id</EM> and <EM>mv_arg</EM> are automatically added when appropriate. (<EM>mv_arg</EM> is the <CODE>arg</CODE> parameter for the tag.)

<P>
If the parameter <CODE>href</CODE> is not supplied, <EM>process</EM> is used, causing normal MiniVend form processing. If the <CODE>href</CODE> points to an http:// link no MiniVend 
<FONT SIZE=-1>URL</FONT> processing will be done, but the mv_session_id

<P>
This would generate a form that ordered item number 99-102 on a separate
line (<CODE>mv_separate_items</CODE> being set), with size <CODE>L</CODE>, in quantity 2. Since the page is not set, you will go to the default
shopping cart page -- equally you could set <CODE>mv_orderpage=yourpage</CODE>
to go to <CODE>yourpage</CODE>.

<P>
All normal MiniVend form caveats apply -- you must have an action, you must
supply a page if you don't want to go to the default, etc.

<P>
You can theoretically submit any form with this, though none of the
included values can have newlines or trailing whitespace. If you want to do
something like that you will have to write a UserTag.

<P>
MiniVend allows you to pass a search in a 
<FONT SIZE=-1>URL.</FONT> Just specify the search with the special page
reference <CODE>scan</CODE>. Here is an example:

<P>
<PRE>     [page scan
            se=Impressionists
            sf=category]
        Impressionist Paintings
     [/page]
</PRE>
<P>
Here is the same thing from a home page (assuming /cgi-bin/vlink is the 
<FONT SIZE=-1>CGI</FONT> path for MiniVend's vlink):

<P>
<PRE>     &lt;A HREF=&quot;/cgi-bin/vlink/scan/se=Impressionists/sf=category&quot;&gt;
        Impressionist Paintings
     &lt;/A&gt;
</PRE>
<P>
Sometimes, you will find that you need to pass characters that will not be
interpreted positionally. In that case, you should quote the arguments:

<P>
<PRE>    [page href=scan
          arg=|
                se=&quot;Something with spaces&quot;
          |]
</PRE>
<P>
The two-letter abbreviations are mapped with these letters:

<P>
<PRE>  DL  mv_raw_dict_look
  MM  mv_more_matches
  SE  mv_raw_searchspec
  ac  mv_all_chars
  ar  mv_arg
  bd  mv_base_directory
  bs  mv_begin_string
  ck  mv_cache_key
  co  mv_coordinate
  cs  mv_case
  cv  mv_verbatim_columns
  de  mv_dict_end
  df  mv_dict_fold
  di  mv_dict_limit
  dl  mv_dict_look
  do  mv_dict_order
  dp  mv_delay_page
  dr  mv_record_delim
  em  mv_exact_match
  er  mv_spelling_errors
  fi  mv_search_file
  fm  mv_first_match
  fn  mv_field_names
  hs  mv_head_skip
  id  mv_session_id
  il  mv_index_delim
  ix  mv_index_delim
  lb  mv_search_label
  lo  mv_list_only
  lr  mv_line_return
  lr  mv_search_line_return
  ml  mv_matchlimit
  mm  mv_max_matches
  mp  mv_profile
  ms  mv_min_string
  ne  mv_negate
  np  mv_nextpage
  nu  mv_numeric
  op  mv_column_op
  os  mv_orsearch
  pc  mv_pc
  ra  mv_return_all
  rd  mv_return_delim
  rf  mv_return_fields
  rg  mv_range_alpha
  rl  mv_range_look
  rm  mv_range_min
  rn  mv_return_file_name
  rr  mv_return_reference
  rs  mv_return_spec
  rx  mv_range_max
  se  mv_searchspec
  sf  mv_search_field
  si  mv_search_immediate
  sp  mv_search_page
  sq  mv_sql_query
  st  mv_searchtype
  su  mv_substring_match
  td  mv_table_cell
  tf  mv_sort_field
  th  mv_table_header
  to  mv_sort_option
  tr  mv_table_row
  un  mv_unique
  va  mv_value
</PRE>
<P>
They can be treated just the same as form variables on the page, except that they can't contain spaces, '/' in a file name, or quote marks. These characters can be used in 
<FONT SIZE=-1>URL</FONT> hex encoding, i.e. <CODE>%20</CODE> is a space, <CODE>%2F</CODE> is a

<CODE>/</CODE>, etc. -- <CODE>&amp;sp;</CODE> or <CODE>&amp;#32;</CODE> will not be recognized. If you use one of the methods below to escape these
``unsafe'' characters, you won't have to worry about this.

<P>
You may specify a one-click search in three different ways. The first is as used in previous versions, with the scan 
<FONT SIZE=-1>URL</FONT> being specified completely as the page name. The second two use the ``argument'' parameter to the
 <CODE>[page ...]</CODE> or
<CODE>[area ...]</CODE> tags to specify the search (an argument to a scan is never valid anyway).

<DL>
<DT><STRONG><A NAME="item_Original">Original</A></STRONG><DD>
<P>
If you wish to do an 
<FONT SIZE=-1>OR</FONT> search on the fields category and artist for the
strings ``Surreal'' and ``Gogh'', while matching substrings, you would do:

<P>
<PRE> [page scan se=Surreal/se=Gogh/os=yes/su=yes/sf=artist/sf=category]
    Van Gogh -- compare to surrealists
 [/page]
</PRE>
<P>
In this method of specification, to replace a / (slash) in a file name (for
the sp, bd, or fi parameter) you must use the shorthand of ::, i.e.
sp=results::standard. (This may not work for some browsers, so you should
probably either put the page in the main pages directory or define the page
in a search profile.)

<DT><STRONG><A NAME="item_Ampersand">Ampersand</A></STRONG><DD>
<P>
You can substitute &amp; for / in the specification and be able to use /
and quotes and spaces in the specification.

<P>
<PRE> [page scan se=&quot;Van Gogh&quot;&amp;sp=lists/surreal&amp;os=yes&amp;su=yes&amp;sf=artist&amp;sf=category]
    Van Gogh -- compare to surrealists
 [/page]
</PRE>
<P>
Any ``unsafe'' characters will be escaped. 

<DT><STRONG><A NAME="item_Multi">Multi-line</A></STRONG><DD>
<P>
You can specify parameters one to a line, as well. 

<P>
<PRE>    [page scan
        se=&quot;Van Gogh&quot;
        sp=lists/surreal
        os=yes
        su=yes
        sf=artist
        sf=category
    ] Van Gogh -- compare to surrealists [/page]
</PRE>
<P>
Any ``unsafe'' characters will be escaped. You may not search for trailing
spaces in this method; it is allowed in the other notations.

</DL>
<P>
New syntax and old syntax handle the tags the same, though if by some odd
chance you wanted to be able to search for a <CODE>]</CODE> (right square bracket) you would need to use new syntax.

<P>
The optional <EM>arg</EM> is used just as in the <EM>page</EM> tag.



code: 03.46
section: TAGS
type: item
title: [/page]

<A NAME="_page_">[/page]</A></H2>
<P>
Expands into &lt;/a&gt;. Used with the page element, such as:

<P>
<PRE>  [page shirts]Our shirt collection[/page]. 
</PRE>
<P>

<FONT SIZE=-1>TIP:</FONT> 
<FONT SIZE=-1>A</FONT> small efficiency boost in large pages is to just use the 
<FONT SIZE=-1>&lt;/A&gt;</FONT> tag.


</DL>
<P>
<HR>


code: 03.47
section: TAGS
type: item
title: perl

<A NAME="perl">perl</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>tables</STRONG>



<P>
Positional parameters in same order.

<P>
<STRONG>The attribute hash reference is passed</STRONG> after the parameters but before the container text argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
This is a container tag, i.e. [perl] 
<FONT SIZE=-1>FOO</FONT> [/perl]. Nesting: 
<FONT SIZE=-1>NO</FONT>


<P>
Invalidates cache: <STRONG>YES</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;perl(
        {
         tables =&gt; VALUE,
        },
        BODY
    )
  
 OR
 
    $Tag-&gt;perl($tables, $ATTRHASH, $BODY);
</PRE>
<P>
Attribute aliases

<P>
<PRE>            table ==&gt; tables
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<PRE>    [perl]
        $name    = $Values-&gt;{name};
        $browser = $Session-&gt;{browser};
        return &quot;Hi, $name! How do you like your $browser?
    [/perl]
</PRE>
<P>

<FONT SIZE=-1>HTML</FONT> example:

<P>
<PRE>    &lt;PRE mv=perl&gt;
        $name    = $Values-&gt;{name};
        $browser = $Session-&gt;{browser};
        return &quot;Hi, $name! How do you like your $browser?
    &lt;/PRE&gt;
</PRE>
<P>
Perl code can be directly embedded in MiniVend pages. The code is specified
as [perl arguments*] any_legal_perl_code [/perl]. The value returned by the
code will be inserted on the page.

<P>
Object references are available for most MiniVend tags and functions, as
well as direct references to MiniVend session and configuration values.

<P>
<PRE>  $CGI-&gt;{key}               Hash reference to raw submitted values
  $CGI_array-&gt;{key}         Arrays of submitted values
  $Carts-&gt;{cartname}        Direct reference to shopping carts
  $Config-&gt;{key}            Direct reference to $Vend::Cfg
  $DbSearch-&gt;array(@args)   Do a DB search and get results
  $Document-&gt;header()       Writes header lines
  $Document-&gt;send()         Writes to output
  $Document-&gt;write()        Writes to page
  $Scratch-&gt;{key}           Direct reference to scratch area
  $Session-&gt;{key}           Direct reference to session area
  $Tag-&gt;tagname(@args)      Call a tag as a routine (UserTag too!)
  $TextSearch-&gt;array(@args) Do a text search and get results
  $Values-&gt;{key}            Direct reference to user form values
  $Variable-&gt;{key}          Config variables (same as $Config-&gt;{Variable});
  &amp;HTML($html)              Same as $Document-&gt;write($html);
  &amp;Log($msg)                Log to the error log
</PRE>
<P>
For full descriptions of these objects, see <EM>MiniVend Programming</EM>.

<P>
If you wish to use database values in your Perl code, you must pre-open the
<CODE>table(s)</CODE> you will be using. This can be done by including the
table name in the <CODE>tables</CODE> parameter of the Perl tag:

<P>
<PRE>    [perl tables=products]
        $result = &quot;You asked about $Values-&gt;{code}. Here is the description: &quot;;
        $result .= $Tag-&gt;data('products', 'description', $Values-&gt;{code});
        return $result;
    [/perl]
</PRE>
<P>
If you do not do this, your code will fail with a runtime Safe error.

</DL>
<P>
<HR>


code: 03.48
section: TAGS
type: item
title: price

<A NAME="price">price</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>code</STRONG>



<P>
Positional parameters in same order.

<P>
<STRONG>The attribute hash reference is passed</STRONG> to the subroutine after the parameters as the last argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;price(
        {
         code =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;price($code, $ATTRHASH);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
Arguments:

<P>
<PRE>        code       Product code/SKU
        base       Only search in product table *base*
        quantity   Price for a quantity
        discount   If true(1), check discount coupons and apply
        noformat   If true(1), don't apply currency formatting
</PRE>
<P>
Expands into the price of the product identified by code as found in the
products database. If there is more than one products file defined, they
will be searched in order unless constrained by the optional argument <STRONG>base</STRONG>. The optional argument <STRONG>quantity</STRONG> selects an entry from the quantity price list. To receive a raw number,
with no currency formatting, use the option <CODE>noformat=1</CODE>.

<P>
MiniVend maintains a price in its database for every product. The price
field is the one required field in the product database -- it is necessary
to build the price routines.

<P>
For speed, MiniVend builds the code that is used to determine a product's
price at catalog configuration time. If you choose to change a directive
that affects product pricing you must reconfigure the catalog.

<P>
Quantity price breaks are configured by means of the <EM>CommonAdjust</EM>
directive. There are a number of CommonAdjust recipes which can be used;
the standard example in the demo calls for a separate pricing table called <CODE>pricing</CODE>. Observe the following:

<P>
<PRE>   CommonAdjust  pricing:q2,q5,q10,q25, ;products:price, ==size:pricing
</PRE>
<P>
This says to check quantity and find the applicable column in the pricing
database and apply it. In this case, it would be:

<P>
<PRE>    2-4      Column *q2*
    5-9      Column *q5*
    10-24    Column *q10*
    25 up    Column *q25*
</PRE>
<P>
What happens if quantity is one? It ``falls back'' to the price that is in
the table <CODE>products</CODE>, column <CODE>price</CODE>.

<P>
After that, if there is a size attribute for the product, the column in the
pricing database corresponding to that column is checked for additions or
subtractions (or even percentage changes).

<P>
If you use this tag in the demo:

<P>
<PRE>    [price code=99-102 quantity=10 size=XL]
</PRE>
<P>
the price will be according to the <CODE>q10</CODE> column, adjusted by what is in the 
<FONT SIZE=-1>XL</FONT> column. (The row is of course 99-102.) The
following entry in pricing:

<P>
<PRE>  code    q2   q5   q10  q25  XL
  99-102  10   9    8    7    .50
</PRE>
<P>
Would yield 8.50 for the price. Quantity of 10 in the <CODE>q10</CODE> column, with 50 cents added for extra large 
<FONT SIZE=-1>(XL).</FONT>

<P>
Following are several examples based on the above entry as well as this the
entry in the <CODE>products</CODE> table:

<P>
<PRE>  code    description   price    size
  99-102  T-Shirt       10.00    S=Small, M=Medium, L=Large*, XL=Extra Large
</PRE>
<P>

<FONT SIZE=-1>NOTE:</FONT> The examples below assume a 
<FONT SIZE=-1>US</FONT> locale with 2 decimal places, use of commas to separate, and a dollar sign ($) as the currency formatting.


<P>
<PRE>  TAG                                             DISPLAYS
  ----------------------------------             ---------------------------
  [price 99-102]                                  $10.00
  [price code=&quot;99-102&quot;]                           $10.00
  [price code=&quot;99-102&quot; quantity=1]                $10.00
  [price code=&quot;99-102&quot; noformat=1]                10
  [price code=&quot;99-102&quot; quantity=5]                $9.00
  [price code=&quot;99-102&quot; quantity=5 size=XL]        $9.50
  [price code=&quot;99-102&quot; size=XL]                   $10.50
  [price code=&quot;99-102&quot; size=XL noformat=1]        10.5
</PRE>
<P>
Product discounts for specific products, all products, or the entire order
can be configured with the [discount ...] tag. Discounts are applied on a
per-user basis -- you can gate the discount based on membership in a club
or other arbitrary means.

<P>
Adding [discount 99-102] <CODE>$s</CODE> * .9[/discount] deducts 10% from
the price at checkout, but the price tag will not show that unless you add
the discount=1 parameter.

<P>
<PRE>    [price code=&quot;99-102&quot;]            --&gt;   $10.00
    [price code=&quot;99-102&quot; discount=1] --&gt;   $9.00
</PRE>
<P>
See <EM>Product Discounts</EM>.

</DL>
<P>
<HR>


code: 03.49
section: TAGS
type: item
title: process

<A NAME="process">process</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Aliases for tag

<P>
process_target

<P>
Parameters: <STRONG>target secure</STRONG>



<P>

<FONT SIZE=-1>ONLY</FONT> 
<FONT SIZE=-1>THE</FONT> <STRONG></STRONG> 
<FONT SIZE=-1>PARAMETERS</FONT> 
<FONT SIZE=-1>ARE</FONT> 
<FONT SIZE=-1>POSITIONAL.</FONT>


<P>
<STRONG>The attribute hash reference is passed</STRONG> to the subroutine after the parameters as the last argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;process(
        {
         target =&gt; VALUE,
         secure =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;process($target, $secure, $ATTRHASH);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.50
section: TAGS
type: item
title: query

<A NAME="query">query</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>sql</STRONG>



<P>
Positional parameters in same order.

<P>
<STRONG>The attribute hash reference is passed</STRONG> after the parameters but before the container text argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
This is a container tag, i.e. [query] 
<FONT SIZE=-1>FOO</FONT> [/query]. Nesting: 
<FONT SIZE=-1>NO</FONT>


<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;query(
        {
         sql =&gt; VALUE,
        },
        BODY
    )
  
 OR
 
    $Tag-&gt;query($sql, $ATTRHASH, $BODY);
</PRE>
<P>
Attribute aliases

<P>
<PRE>            query ==&gt; sql
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.51
section: TAGS
type: item
title: read_cookie

<A NAME="read_cookie">read_cookie</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>name</STRONG>



<P>

<FONT SIZE=-1>ONLY</FONT> 
<FONT SIZE=-1>THE</FONT> <STRONG></STRONG> 
<FONT SIZE=-1>PARAMETERS</FONT> 
<FONT SIZE=-1>ARE</FONT> 
<FONT SIZE=-1>POSITIONAL.</FONT>


<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>YES</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;read_cookie(
        {
         name =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;read_cookie($name);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.52
section: TAGS
type: item
title: record

<A NAME="record">record</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
No parameters.

<P>
<STRONG>The attribute hash reference is passed</STRONG> to the subroutine after the parameters as the last argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;record(
        {
        }
    )
  
 OR
 
    $Tag-&gt;record($ATTRHASH);
</PRE>
<P>
Attribute aliases

<P>
<PRE>            code ==&gt; key
            column ==&gt; col
            field ==&gt; col
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.53
section: TAGS
type: item
title: region

<A NAME="region">region</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
No parameters.

<P>
<STRONG>The attribute hash reference is passed</STRONG> after the parameters but before the container text argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
This is a container tag, i.e. [region] 
<FONT SIZE=-1>FOO</FONT> [/region]. Nesting: 
<FONT SIZE=-1>NO</FONT>


<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;region(
        {
        },
        BODY
    )
  
 OR
 
    $Tag-&gt;region($ATTRHASH, $BODY);
</PRE>
<P>
Attribute aliases

<P>
<PRE>            args ==&gt; arg
            params ==&gt; arg
            search ==&gt; arg
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.54
section: TAGS
type: item
title: row

<A NAME="row">row</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>width</STRONG>



<P>
Positional parameters in same order.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Interpolates <STRONG>container text</STRONG> by default&gt;.

<P>
This is a container tag, i.e. [row] 
<FONT SIZE=-1>FOO</FONT> [/row]. Nesting: 
<FONT SIZE=-1>NO</FONT>


<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;row(
        {
         width =&gt; VALUE,
        },
        BODY
    )
  
 OR
 
    $Tag-&gt;row($width, $BODY);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
Formats text in tables. Intended for use in emailed reports or &lt;
<FONT SIZE=-1>PRE&gt;&lt;</FONT>
<FONT SIZE=-1>/PRE&gt;</FONT> 
<FONT SIZE=-1>HTML</FONT> areas. The parameter
 <EM>nn</EM> gives the number of columns to use. Inside the row tag, [col param=value
...] tags may be used. 

<DL>
<DT><STRONG><A NAME="item__col">[col width=nn wrap=yes|no gutter=n align=left|right|input spacing=n]</A></STRONG><DD>
<P>
Sets up a column for use in a [row]. This parameter can only be contained
inside a [row nn] [/row] tag pair. Any number of columns (that fit within
the size of the row) can be defined.

<P>
The parameters are:

<P>
<PRE>    width=nn        The column width, I&lt;including the gutter&gt;. Must be
                    supplied, there is no default. A shorthand method
                    is to just supply the number as the I&lt;first&gt; parameter,
                    as in [col 20].
        
    gutter=n        The number of spaces used to separate the column (on
                    the right-hand side) from the next. Default is 2.
        
    spacing=n       The line spacing used for wrapped text. Default is 1,
                    or single-spaced.
        
    wrap=(yes|no)   Determines whether text that is greater in length than
                    the column width will be wrapped to the next line. Default
                    is I&lt;yes&gt;.
        
    align=(L|R|I)   Determines whether text is aligned to the left (the default),
                    the right, or in a way that might display an HTML text
                    input field correctly.
</PRE>
<DT><STRONG><A NAME="item__col_">[/col]</A></STRONG><DD>
<P>
Terminates the column field.

</DL>
</DL>
<P>
<HR>


code: 03.55
section: TAGS
type: item
title: salestax

<A NAME="salestax">salestax</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>name noformat</STRONG>



<P>
Positional parameters in same order.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;salestax(
        {
         name =&gt; VALUE,
         noformat =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;salestax($name, $noformat);
</PRE>
<P>
Attribute aliases

<P>
<PRE>            cart ==&gt; name
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
Expands into the sales tax on the subtotal of all the items ordered so far
for the cart, default cart is <CODE>main</CODE>. If there is no key field to derive the proper percentage, such as state
or zip code, it is set to 0. If the noformat tag is present and non-zero,
the raw number with no currency formatting will be given.

</DL>
<P>
<HR>


code: 03.56
section: TAGS
type: item
title: scratch

<A NAME="scratch">scratch</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>name</STRONG>



<P>
Positional parameters in same order.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>YES</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;scratch(
        {
         name =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;scratch($name);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
Returns the contents of a scratch variable to the page. 
<FONT SIZE=-1>(A</FONT> scratch variable is set with a [set] value [/set]
container pair.)

</DL>
<P>
<HR>


code: 03.57
section: TAGS
type: item
title: search

<A NAME="search">search</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>arg</STRONG>



<P>
Positional parameters in same order.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;search(
        {
         arg =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;search($arg);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.58
section: TAGS
type: item
title: search_region

<A NAME="search_region">search_region</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>arg</STRONG>



<P>

<FONT SIZE=-1>ONLY</FONT> 
<FONT SIZE=-1>THE</FONT> <STRONG></STRONG> 
<FONT SIZE=-1>PARAMETERS</FONT> 
<FONT SIZE=-1>ARE</FONT> 
<FONT SIZE=-1>POSITIONAL.</FONT>


<P>
<STRONG>The attribute hash reference is passed</STRONG> after the parameters but before the container text argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
This is a container tag, i.e. [search_region] 
<FONT SIZE=-1>FOO</FONT> [/search_region]. Nesting: 
<FONT SIZE=-1>NO</FONT>


<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;search_region(
        {
         arg =&gt; VALUE,
        },
        BODY
    )
  
 OR
 
    $Tag-&gt;search_region($arg, $ATTRHASH, $BODY);
</PRE>
<P>
Attribute aliases

<P>
<PRE>            args ==&gt; arg
            params ==&gt; arg
            search ==&gt; arg
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.59
section: TAGS
type: item
title: selected

<A NAME="selected">selected</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>name value multiple</STRONG>



<P>
Positional parameters in same order.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>YES</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;selected(
        {
         name =&gt; VALUE,
         value =&gt; VALUE,
         multiple =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;selected($name, $value, $multiple);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
You can provide a ``memory'' for drop-down menus, radio buttons, and
checkboxes with the [checked] and [selected] tags.

<P>
This will output 
<FONT SIZE=-1>SELECTED</FONT> if the variable <CODE>var_name</CODE> is equal to
<A HREF="#item_value">value</A>. If the optional 
<FONT SIZE=-1>MULTIPLE</FONT> argument is present, it will look for any of
a variety of values. Not case sensitive.

<P>
Here is a drop-down menu that remembers an item-modifier color selection:

<P>
<PRE>    &lt;SELECT NAME=&quot;color&quot;&gt;
    &lt;OPTION [selected color blue]&gt; Blue
    &lt;OPTION [selected color green]&gt; Green
    &lt;OPTION [selected color red]&gt; Red
    &lt;/SELECT&gt;
</PRE>
<P>
Here is the same thing, but for a shopping-basket color selection

<P>
<PRE>    &lt;SELECT NAME=&quot;[modifier-name color]&quot;&gt;
    &lt;OPTION [selected [modifier-name color] blue]&gt; Blue
    &lt;OPTION [selected [modifier-name color] green]&gt; Green
    &lt;OPTION [selected [modifier-name color] red]&gt; Red
    &lt;/SELECT&gt;
</PRE>
</DL>
<P>
<HR>


code: 03.60
section: TAGS
type: item
title: set

<A NAME="set">set</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>name</STRONG>



<P>
Positional parameters in same order.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
This is a container tag, i.e. [set] 
<FONT SIZE=-1>FOO</FONT> [/set]. Nesting: 
<FONT SIZE=-1>NO</FONT>


<P>
Invalidates cache: <STRONG>YES</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;set(
        {
         name =&gt; VALUE,
        },
        BODY
    )
  
 OR
 
    $Tag-&gt;set($name, $BODY);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
Sets a scratch variable to <EM>value</EM>.

<P>
Most of the mv_* variables that are used for search and order conditionals
are in another namespace -- they can be set by means of hidden fields in a
form.

<P>
You can set an order profile with:

<P>
<PRE>  [set checkout]
  name=required
  address=required
  [/set]
  &lt;INPUT TYPE=hidden NAME=mv_order_profile VALUE=&quot;checkout&quot;&gt;
</PRE>
<P>

<FONT SIZE=-1>A</FONT> search profile would be set with:

<P>
<PRE>  [set substring_case]
  mv_substring_match=yes
  mv_case=yes
  [/set]
  &lt;INPUT TYPE=hidden NAME=mv_profile VALUE=&quot;substring_case&quot;&gt;
</PRE>
<P>
Any of these profile values can be set in the OrderProfile files as well.

</DL>
<P>
<HR>


code: 03.61
section: TAGS
type: item
title: set_cookie

<A NAME="set_cookie">set_cookie</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>name value expire</STRONG>



<P>

<FONT SIZE=-1>ONLY</FONT> 
<FONT SIZE=-1>THE</FONT> <STRONG></STRONG> 
<FONT SIZE=-1>PARAMETERS</FONT> 
<FONT SIZE=-1>ARE</FONT> 
<FONT SIZE=-1>POSITIONAL.</FONT>


<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>YES</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;set_cookie(
        {
         name =&gt; VALUE,
         value =&gt; VALUE,
         expire =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;set_cookie($name, $value, $expire);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.62
section: TAGS
type: item
title: seti

<A NAME="seti">seti</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>name</STRONG>



<P>
Positional parameters in same order.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Interpolates <STRONG>container text</STRONG> by default&gt;.

<P>
This is a container tag, i.e. [seti] 
<FONT SIZE=-1>FOO</FONT> [/seti]. Nesting: 
<FONT SIZE=-1>NO</FONT>


<P>
Invalidates cache: <STRONG>YES</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;seti(
        {
         name =&gt; VALUE,
        },
        BODY
    )
  
 OR
 
    $Tag-&gt;seti($name, $BODY);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.63
section: TAGS
type: item
title: setlocale

<A NAME="setlocale">setlocale</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>locale currency</STRONG>



<P>
Positional parameters in same order.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;setlocale(
        {
         locale =&gt; VALUE,
         currency =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;setlocale($locale, $currency);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.64
section: TAGS
type: item
title: shipping

<A NAME="shipping">shipping</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>mode</STRONG>



<P>
Positional parameters in same order.

<P>
<STRONG>The attribute hash reference is passed</STRONG> to the subroutine after the parameters as the last argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;shipping(
        {
         mode =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;shipping($mode, $ATTRHASH);
</PRE>
<P>
Attribute aliases

<P>
<PRE>            carts ==&gt; cart
            modes ==&gt; mode
            name ==&gt; mode
            tables ==&gt; table
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
The shipping cost of the items in the basket via <CODE>mode</CODE> -- the default mode is the shipping mode currently selected in the <CODE>mv_shipmode</CODE>
variable. See <EM>SHIPPING</EM>.

</DL>
<P>
<HR>


code: 03.65
section: TAGS
type: item
title: shipping_desc

<A NAME="shipping_desc">shipping_desc</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Aliases for tag

<P>
shipping_description

<P>
Parameters: <STRONG>mode</STRONG>



<P>
Positional parameters in same order.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;shipping_desc(
        {
         mode =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;shipping_desc($mode);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.66
section: TAGS
type: item
title: sql

<A NAME="sql">sql</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>type query</STRONG>



<P>
Positional parameters in same order.

<P>
<STRONG>The attribute hash reference is passed</STRONG> after the parameters but before the container text argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
This is a container tag, i.e. [sql] 
<FONT SIZE=-1>FOO</FONT> [/sql]. Nesting: 
<FONT SIZE=-1>NO</FONT>


<P>
Invalidates cache: <STRONG>YES</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;sql(
        {
         type =&gt; VALUE,
         query =&gt; VALUE,
        },
        BODY
    )
  
 OR
 
    $Tag-&gt;sql($type, $query, $ATTRHASH, $BODY);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.67
section: TAGS
type: item
title: strip

<A NAME="strip">strip</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
No parameters.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
This is a container tag, i.e. [strip] 
<FONT SIZE=-1>FOO</FONT> [/strip]. Nesting: 
<FONT SIZE=-1>NO</FONT>


<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;strip(
        {
        },
        BODY
    )
  
 OR
 
    $Tag-&gt;strip($BODY);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.68
section: TAGS
type: item
title: subtotal

<A NAME="subtotal">subtotal</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>name noformat</STRONG>



<P>
Positional parameters in same order.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>YES</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;subtotal(
        {
         name =&gt; VALUE,
         noformat =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;subtotal($name, $noformat);
</PRE>
<P>
Attribute aliases

<P>
<PRE>            cart ==&gt; name
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
Positional: [subtotal cart* noformat*]

<P>
mandatory: 
<FONT SIZE=-1>NONE</FONT>

<P>
optional: cart noformat

<P>
Expands into the subtotal cost, exclusive of sales tax, of all the items
ordered so far for the optional <CODE>cart</CODE>. If the noformat tag is present and non-zero, the raw number with no
currency formatting will be given.

</DL>
<P>
<HR>


code: 03.69
section: TAGS
type: item
title: tag

<A NAME="tag">tag</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>op arg</STRONG>



<P>
Positional parameters in same order.

<P>
<STRONG>The attribute hash reference is passed</STRONG> after the parameters but before the container text argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
This is a container tag, i.e. [tag] 
<FONT SIZE=-1>FOO</FONT> [/tag]. Nesting: 
<FONT SIZE=-1>NO</FONT>


<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;tag(
        {
         op =&gt; VALUE,
         arg =&gt; VALUE,
        },
        BODY
    )
  
 OR
 
    $Tag-&gt;tag($op, $arg, $ATTRHASH, $BODY);
</PRE>
<P>
Attribute aliases

<P>
<PRE>            description ==&gt; arg
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
Performs any of a number of operations, based on the presence of <CODE>arg</CODE>. The arguments that may be given are:

<DL>
<DT><STRONG><A NAME="item_export">export database file* type*</A></STRONG><DD>
<P>
Exports a complete MiniVend database to its text source file (or any
specified file). The integer <CODE>n</CODE>, if specified, will select export in one of the enumerated MiniVend export
formats. The following tag will export the products database to
products.txt (or whatever you have defined its source file as), in the
format specified by the
<EM>Database</EM> directive:

<P>
<PRE>    [tag export products][/tag]
</PRE>
<P>
Same thing, except to the file products/new_products.txt:

<P>
<PRE>    [tag export products products/newproducts.txt][/tag]
</PRE>
<P>
Same thing, except the export is done with a 
<FONT SIZE=-1>PIPE</FONT> delimiter:

<P>
<PRE>    [tag export products products/newproducts.txt 5][/tag]
</PRE>
<P>
The file is relative to the catalog directory, and only may be an absolute
path name if <EM>NoAbsolute</EM> is set to <CODE>No</CODE>.

<DT><STRONG><A NAME="item_flag">flag arg</A></STRONG><DD>
<P>
Sets a MiniVend condition.

<P>
The following enables writes on the <CODE>products</CODE> and <CODE>sizes</CODE> databases held in MiniVend internal 
<FONT SIZE=-1>DBM</FONT> format:

<P>
<PRE>    [tag flag write]products sizes[/tag]
</PRE>
<P>

<FONT SIZE=-1>SQL</FONT> databases are always writable if allowed by the 
<FONT SIZE=-1>SQL</FONT> database itself -- in-memory databases will never be written.


<P>
The [tag flag build][/tag] combination forces static build of a page, even
if dynamic elements are contained. Similarly, the [tag flag cache][/tag]
forces search or page caching (not usually wise).

<DT><STRONG><A NAME="item_log">log dir/file</A></STRONG><DD>
<P>
Logs a message to a file, fully interpolated for MiniVend tags. The
following tag will send every item code and description in the user's
shopping cart to the file logs/transactions.txt:

<P>
<PRE>    [tag log logs/transactions.txt]
    [item_list][item-code]  [item-description]
    [/item_list][/tag]
</PRE>
<P>
The file is relative to the catalog directory, and only may be an absolute
path name if <EM>NoAbsolute</EM> is set to <CODE>No</CODE>.

<DT><STRONG><A NAME="item_mime">mime description_string</A></STRONG><DD>
<P>
Returns a MIME-encapsulated message with the boundary as employed in the
other mime tags, and the <CODE>description_string</CODE> used as the Content-Description. For example

<P>
<PRE>   [tag mime My Plain Text]Your message here.[/tag]
</PRE>
<P>
will return

<P>
<PRE>  Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
  Content-ID: [sequential, lead as in mime boundary]
  Content-Description: My Plain Text
  
  Your message here.
</PRE>
<P>
When used in concert with [tag mime boundary], [tag mime header], and [tag mime id], allows 
<FONT SIZE=-1>MIME</FONT> attachments to be included -- typically with PGP-encrypted credit card numbers. See the demo page ord/report.html for an example.


<DT><STRONG>mime boundary</STRONG><DD>
<P>
Returns a 
<FONT SIZE=-1>MIME</FONT> message boundary with unique string keyed on session 
<FONT SIZE=-1>ID,</FONT> page count, and time.


<DT><STRONG>mime header</STRONG><DD>
<P>
Returns a 
<FONT SIZE=-1>MIME</FONT> message header with the proper boundary for that session 
<FONT SIZE=-1>ID,</FONT> page count, and time.


<DT><STRONG>mime id</STRONG><DD>
<P>
Returns a 
<FONT SIZE=-1>MIME</FONT> message id with the proper boundary for that session 
<FONT SIZE=-1>ID,</FONT> page count, and time.


<DT><STRONG><A NAME="item_show_tags">show_tags</A></STRONG><DD>
<P>
The encased text will not be substituted for with MiniVend tags, with &lt; and [ characters changed to <CODE>&amp;</CODE>#lt; and <CODE>&amp;</CODE>#91; respectively.

<P>
<PRE>    [tag show_tags][value whatever][/tag]
</PRE>
<DT><STRONG><A NAME="item_time">time</A></STRONG><DD>
<P>
Formats the current time according to 
<FONT SIZE=-1>POSIX</FONT> strftime arguments. The following is the string
for Thursday, April 30, 1997.

<P>
<PRE>    [tag time]%A, %B %d, %Y[/tag]
</PRE>
<DT><STRONG><A NAME="item_touch">touch</A></STRONG><DD>
<P>
Touches a database to allow use of the <CODE>tag_data()</CODE> routine in
user-defined subroutines. If this is not done, the routine will error out
if the database has not previously been accessed on the page.

<P>
<PRE>    [tag touch products][/tag]
</PRE>
</DL>
</DL>
<P>
<HR>


code: 03.70
section: TAGS
type: item
title: time

<A NAME="time">time</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>type param</STRONG>



<P>
Positional parameters in same order.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;time(
        {
         type =&gt; VALUE,
         param =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;time($type, $param);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.71
section: TAGS
type: item
title: timed_build

<A NAME="timed_build">timed_build</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>file</STRONG>



<P>
Positional parameters in same order.

<P>
<STRONG>The attribute hash reference is passed</STRONG> after the parameters but before the container text argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
This is a container tag, i.e. [timed_build] 
<FONT SIZE=-1>FOO</FONT> [/timed_build]. Nesting: 
<FONT SIZE=-1>NO</FONT>


<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;timed_build(
        {
         file =&gt; VALUE,
        },
        BODY
    )
  
 OR
 
    $Tag-&gt;timed_build($file, $ATTRHASH, $BODY);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.72
section: TAGS
type: item
title: total_cost

<A NAME="total_cost">total_cost</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>name noformat</STRONG>



<P>
Positional parameters in same order.

<P>
Pass attribute hash as last to subroutine: <STRONG>no</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>YES</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;total_cost(
        {
         name =&gt; VALUE,
         noformat =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;total_cost($name, $noformat);
</PRE>
<P>
Attribute aliases

<P>
<PRE>            cart ==&gt; name
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
Expands into the total cost of all the items in the current shopping cart,
including sales tax (if any).

</DL>
<P>
<HR>


code: 03.73
section: TAGS
type: item
title: try

<A NAME="try">try</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>label</STRONG>



<P>
Positional parameters in same order.

<P>
<STRONG>The attribute hash reference is passed</STRONG> after the parameters but before the container text argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
This is a container tag, i.e. [try] 
<FONT SIZE=-1>FOO</FONT> [/try]. Nesting: 
<FONT SIZE=-1>NO</FONT>


<P>
Invalidates cache: <STRONG>no</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;try(
        {
         label =&gt; VALUE,
        },
        BODY
    )
  
 OR
 
    $Tag-&gt;try($label, $ATTRHASH, $BODY);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.74
section: TAGS
type: item
title: update

<A NAME="update">update</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>function</STRONG>



<P>

<FONT SIZE=-1>ONLY</FONT> 
<FONT SIZE=-1>THE</FONT> <STRONG></STRONG> 
<FONT SIZE=-1>PARAMETERS</FONT> 
<FONT SIZE=-1>ARE</FONT> 
<FONT SIZE=-1>POSITIONAL.</FONT>


<P>
<STRONG>The attribute hash reference is passed</STRONG> to the subroutine after the parameters as the last argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>YES</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;update(
        {
         function =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;update($function, $ATTRHASH);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
<STRONG>NO DESCRIPTION</STRONG>



</DL>
<P>
<HR>


code: 03.75
section: TAGS
type: item
title: userdb

<A NAME="userdb">userdb</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>function</STRONG>



<P>
Positional parameters in same order.

<P>
<STRONG>The attribute hash reference is passed</STRONG> to the subroutine after the parameters as the last argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>YES</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;userdb(
        {
         function =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;userdb($function, $ATTRHASH);
</PRE>
<P>
Attribute aliases

<P>
<PRE>            name ==&gt; nickname
            table ==&gt; db
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
MiniVend provides a <CODE>[userdb ...]</CODE> tag to access the UserDB functions.

<P>
<PRE> [userdb
        function=function_name
        username=&quot;username&quot;*
        password=&quot;password&quot;*
        verify=&quot;password&quot;*
        oldpass=&quot;old password&quot;*
        shipping=&quot;fields for shipping save&quot;
        billing=&quot;fields for billing save&quot;
        preferences=&quot;fields for preferences save&quot;
        force_lower=1
        param1=value*
        param2=value*
        ...
        ]
</PRE>
<P>
* Optional

<P>
It is normally called in an <CODE>mv_click</CODE> or <CODE>mv_check</CODE> setting, as in:

<P>
<PRE>    [set Login]
    mv_todo=return
    mv_nextpage=welcome
    [userdb function=login]
    [/set]
</PRE>
<P>
<PRE>    &lt;FORM ACTION=&quot;[process-target]&quot; METHOD=POST&gt;
    &lt;INPUT TYPE=hidden NAME=mv_click VALUE=Login&gt;
    Username &lt;INPUT NAME=mv_username SIZE=10&gt;
    Password &lt;INPUT NAME=mv_password SIZE=10&gt;
    &lt;/FORM&gt;
</PRE>
<P>
There are several global parameters that apply to any use of the <CODE>userdb</CODE> functions. Most importantly, by default the database table is set to be <EM>userdb</EM>. If you must use another table name, then you should include a <CODE>database=table</CODE> parameter with any call to <CODE>userdb</CODE>. The global parameters (default in parens):

<P>
<PRE>    database     Sets user database table (userdb)
    show         Show the return value of certain functions
                 or the error message, if any (0)
    force_lower  Force possibly upper-case database fields
                 to lower case session variable names (0)
    billing      Set the billing fields (see Accounts)
    shipping     Set the shipping fields (see Address Book)
    preferences  Set the preferences fields (see Preferences)
    bill_field   Set field name for accounts (accounts)
    addr_field   Set field name for address book (address_book)
    pref_field   Set field name for preferences (preferences)
    cart_field   Set field name for cart storage (carts)
    pass_field   Set field name for password (password)
    time_field   Set field for storing last login time (time)
    expire_field Set field for expiration date (expire_date)
    acl          Set field for simple access control storage (acl)
    file_acl     Set field for file access control storage (file_acl)
    db_acl       Set field for database access control storage (db_acl)
</PRE>
</DL>
<P>
<HR>


code: 03.75
section: TAGS
type: item
title: value_extended

<A NAME="value_extended">value_extended</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>name</STRONG>



<P>
Positional parameters in same order.

<P>
<STRONG>The attribute hash reference is passed</STRONG> to the subroutine after the parameters as the last argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>YES</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;value_extended(
        {
         name =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;value_extended($name, $ATTRHASH);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>
Named call example:

<P>
<PRE>   [value-extended 
            name=formfield
            outfile=filename*
            ascii=1*
            yes=&quot;Yes&quot;*
            no=&quot;No&quot;*
            joiner=&quot;char|string&quot;*
            test=&quot;isfile|length|defined&quot;*
            index=&quot;N|N..N|*&quot;
            file_contents=1*
            elements=1*]
</PRE>
<P>
Expands into the current value of the customer/form input field named by
field. If there are multiple elements of that variable, it will return the
value at <A HREF="#item_index">index</A>; by default all joined together with a space.

<P>
If the variable is a file variable coming from a multipart/form-data file
upload, then the contents of that upload can be returned to the page or
optionally written to the <A HREF="#item_outfile">outfile</A>.

<DL>
<DT><STRONG>name</STRONG><DD>
<P>
The form variable 
<FONT SIZE=-1>NAME.</FONT> If no other parameters are present, then the
value of the variable will be returned. If there are multiple elements,
then by default they will all be returned joined by a space. If <A HREF="#item_joiner">joiner</A>
is present, then they will be joined by its value.

<P>
In the special case of a file upload, the value returned is the name of the
file as passed for upload.

<DT><STRONG><A NAME="item_joiner">joiner</A></STRONG><DD>
<P>
The character or string that will join the elements of the array. Will
accept string literals such as ``\n'' or ``\r''.

<DT><STRONG><A NAME="item_test">test</A></STRONG><DD>
<P>
Three tests -- <CODE>isfile</CODE> returns true if the variable is a file upload.
<CODE>length</CODE> returns the length. <CODE>defined</CODE> returns whether the value has ever been set at all on a form.

<DT><STRONG><A NAME="item_index">index</A></STRONG><DD>
<P>
The index of the element to return if not all are wanted. This is useful
especially for pre-setting multiple search variables. If set to <CODE>*</CODE>, will return all (joined by <A HREF="#item_joiner">joiner</A>). If a range, such as <CODE>0 .. 2</CODE>, will return multiple elements.

<DT><STRONG><A NAME="item_file_contents">file_contents</A></STRONG><DD>
<P>
Returns the contents of a file upload if set to a non-blank, non-zero
value. If the variable is not a file, returns nothing.

<DT><STRONG><A NAME="item_outfile">outfile</A></STRONG><DD>
<P>
Names a file to write the contents of a file upload to. It will not accept an absolute file name; the name must be relative to the catalog directory. If you wish to write images or other files that would go to 
<FONT SIZE=-1>HTML</FONT> space, you must use the 
<FONT SIZE=-1>HTTP</FONT> server's
 <A HREF="#item_Alias">Alias</A> facilities or make a symbolic link.

<DT><STRONG><A NAME="item_ascii">ascii</A></STRONG><DD>
<P>
To do an auto-ASCII translation before writing the <A HREF="#item_outfile">outfile</A>, set the <A HREF="#item_ascii">ascii</A> parameter to a non-blank, non-zero value. Default is no translation.

<DT><STRONG><A NAME="item_yes">yes</A></STRONG><DD>
<P>
The value that will be returned if a test is true or a file is written
successfully. Defaults to <CODE>1</CODE> for tests and the empty string for uploads.

<DT><STRONG><A NAME="item_no">no</A></STRONG><DD>
<P>
The value that will be returned if a test is false or a file write fails.
Defaults to the empty string.

</DL>
</DL>
<P>
<HR>


code: 03.76
section: TAGS
type: item
title: value

<A NAME="value">value</A></H2>
<DL>
<DT><STRONG>CALL INFORMATION</STRONG><DD>
<P>
Parameters: <STRONG>name</STRONG>



<P>
Positional parameters in same order.

<P>
<STRONG>The attribute hash reference is passed</STRONG> to the subroutine after the parameters as the last argument.
<STRONG>This may mean that there are parameters not shown here.</STRONG>



<P>
Must pass named parameter interpolate=1 to cause interpolation.

<P>
Invalidates cache: <STRONG>YES</STRONG>



<P>
Called Routine: 

<P>
ASP/perl tag calls:

<P>
<PRE>    $Tag-&gt;value(
        {
         name =&gt; VALUE,
        }
    )
  
 OR
 
    $Tag-&gt;value($name, $ATTRHASH);
</PRE>
<P>
<PRE> 
</PRE>
<DT><STRONG>DESCRIPTION</STRONG><DD>
<P>

<FONT SIZE=-1>HTML</FONT> examples:

<P>
<PRE>   &lt;PARAM MV=&quot;value name&quot;&gt;
   &lt;INPUT TYPE=&quot;text&quot; NAME=&quot;name&quot; VALUE=&quot;[value name]&quot;&gt;
</PRE>
<P>
Expands into the current value of the customer/form input field named by
field. If <A HREF="#item_flag">flag</A> is present, single quotes will be escaped with a backslash; this allows you
to contain the <A HREF="#item__value_">[value ...]</A> tag within single quotes. (It is somewhat better to use other quoting
methods.) When the value is returned, any MiniVend tags present in the
value will be escaped. This prevents users from entering MiniVend tags in
form values, which would be a serious security risk.

<P>
If the <CODE>set</CODE> value is present, the form variable value will be set to it and the empty
string returned. Use this to ``uncheck'' a checkbox or set other form
variable values to defaults. <STRONG>NOTE:</STRONG> This is only available in new-style tags, for safety reasons.

</DL>
<P>
<HR>


code: 04.00
section: TAGS
type: overview
title: TAGS

<A NAME="TAGS">TAGS</A></H1>
<P>
Each 
<FONT SIZE=-1>MML</FONT> tag is show below. Calling information is defined
for the main tag, sub-tags are described in <CODE>Sub-tags</CODE>.

<P>
<HR>


