-
[/calc]
-
Terminates the calculated region.
-
[/col]
-
Terminates the column field.
-
[/if]
-
Terminates an if conditional.
-
[/if_data]
-
Terminates an [if_field fieldname] element.
-
[/if_field]
-
Terminates an [if_field fieldname] element.
COMPATIBILITY NOTE: MiniVend 1.02 used the [/if] end tag for
an [if_field] element. This was supported through MiniVend 1.03,
but is gone in 2.0 -- you may need to change it.
-
[/if_loop_data]
-
Alias for [/if_data] valid only in [loop list] [/loop].
-
[/if_loop_field]
-
Alias for [/if_field] valid only in [loop list] [/loop].
COMPATIBILITY NOTE: MiniVend 1.02 used the [/if] end tag for
an [if_field] element. This was supported through MiniVend 1.03,
but is gone in 2.0 -- you may need to change it.
-
[/item_list]
-
Terminates the [item_list] tag.
-
[/more_list]
-
Terminates the [more_list] tag.
-
[/order]
-
Expands into </a>. Used with the order element, such as: Buy a
[order TK112]Toaster[/order] today.
-
[/page], [/pagetarget]
-
Expands into </a>. Used with the page or pagetarget elements, such as:
[page shirts]Our shirt collection[/page] or [pagetarget pants main] Our
pants collection[/pagetarget]. They are syntactically the same, so
you can use either one to terminate an anchor -- the two different ones
are provided for consistency. It will very slightly improve MiniVend
performance if you simply use </A> instead.
-
[/row]
-
Terminates a [row nn] element.
-
[/search_list]
-
Ends the search list.
-
[accessories code]
-
Expands into the value of the accessories database entry for the product
identified by code as found in the products database.
-
[area pg]
-
Like the areatarget element, except it will never yield
a frame target.
-
[areatarget pg frame]
-
Inserts a Vend URL in a format to provide a targeted reference for a
client-side imagemap. You set up the <AREA> tag with:
If frames are enabled, this will expand to:
If frames are not enabled, this will expand to:
-
[body n]
-
Selects from the predefined color schemes and/or backgrounds, and
just becomes a <BODY> tag if none are defined. See
Controlling Page Appearance.
-
[buttonbar n]
-
Selects from the predefined buttonbars, and is stripped if it
doesn't exist. See Controlling Page Appearance.
-
[calc]
-
Starts a region where the arguments are calculated according to normal
arithmetic symbols. For instance:
[calc] 2 + 2 [/calc]
will display:
4
-
[cart name]
-
Sets the name of the current shopping cart for display of shipping, price,
total, subtotal, and nitems tags. If you wish to use a different price for
the cart, all of the above except [nitems] and [shipping] will reflect the
normal price field -- you must emulate those operations with embedded Perl
or the [item-list], [calc], and [currency] tags.
-
[checked var_name value]
-
This will output CHECKED if the variable var_name is equal to
value
. Not case sensitive.
-
[col width=nn wrap=yes|no gutter=n align=left|right|input spacing=n]
-
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.
The parameters are:
width=nn The column width, I. Must be
supplied, there is no default. A shorthand method
is to just supply the number as the I 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.
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.
-
[currency]
-
When passed a value of a single number, formats it according to the
currency specification. For instance:
[currency]4[/currency]
will display:
4.00
Uses the Locale, PriceDivide, and PriceComma settings as
appropriate, and can contain a [calc] region. If Locale is set to 'pt',
and PriceDivide to 100, the following
[currency] [calc] 50000 + 100000 [/calc] [/currency]
the number 1.500,00 will be displayed.
-
[data area field key]
-
Returns the value of the field in any of the arbitrary databases,
or from the variable namespaces. Databases will hide variables, so
don't name a database ``session'', ``scratch'', or any of the other
reserved names! Case is sensitive, so in a pinch you could call the
database ``Session'', but it would be better not to.
-
[description code]
-
Expands into the description of code as found in the products
database.
-
[else] text [/else]
-
The optional else-text for an if or if_field conditional.
-
[field name code]
-
Expands into the value of the field name for the product
identified by code as found in the products database.
IMPORTANT: If the field name is not a field in the
database, the MiniVend server will stop with an error.
-
[finish_order page*]
-
This element is used to give the customer, while browsing, a way to go
to the order page (or optional checkout page) after they have ordered
something. If they haven't ordered anything yet [finish_order] does not
appear at all on the displayed page. If they have ordered an item, the
element will expand into something like:
Finish Incomplete Order
If the optional page is supplied, that will be the order page used
to finish the order.
-
[frames_off]
-
Turns off the frames processing option. This can be used to disable
frames, perhaps as a clickable option for users. It is persistent for
the entire session, or until counteracted with a [frames_on] tag.
-
[frames_on]
-
Turns on the frames processing option, which is disabled by default.
The proper way to use this is to put it ONLY in a page which is loaded
by frame-based browsers, as part of the initial frame load. It is
persistent for the entire session, or until counteracted with a
[frames_off] tag.
-
[if type field op* compare*]
-
Allows conditional building of HTML based on the setting of various MiniVend
session and database values. Accessible areas are:
-
accessory
-
The accessories database.
-
config
-
The MiniVend configuration variables. These are set
by the directives in your MiniVend configuration file (or
the defaults).
-
explicit
-
Allows you to specify an explicit test, perhaps generated
from another MiniVend tag element. Uses Perl conditionals,
and strings may be quoted. You might do:
[if explicit "[item-field category]" eq shirt]
This is a shirt.
[else]
Not a shirt.
[/else]
[/if]
If the above is on a flypage, or within an [item-list], the [item-data]
tag will already be interpolated and replaced with the value of the
product database field category. You should use quotes in case
the item field contains white space.
-
salestax
-
The salestax database.
-
scratch
-
The MiniVend scratchpad variables, which can be set
with the [set name]value[/set] element.
-
session
-
The MiniVend session variables. Of particular interest
are login, frames, secure, and browser.
-
shipping
-
The shipping database.
-
validcc
-
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
checksum digit calculation to weed out typos or phony
card numbers.
-
value
-
The MiniVend user variables, typically set in search,
control, or order forms. Variables beginning with 'mv_'
are MiniVend special values, and should be tested/used
with caution.
.
-
[item_list]
-
Places an iterative list of the items in the shopping cart.
Within any display 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.
Between the item_list markers the various [item] elements will return
information for the current item.
-
[if_data fieldname]
-
If the arbitrary database field fieldname is non-blank, the following
text up to the [/if_data] tag is substituted. This can be used to
substitute IMG or other tags only if the corresponding source
item is present. Also accepts a [else]else text[/else] pair
for the opposite condition.
-
[if_field fieldname]
-
If the database field fieldname is non-blank, the following
text up to the [/if_field] tag is substituted. This can be used to
substitute IMG or other tags only if the corresponding source
item is present. Also accepts a [else]else text[/else] pair
for the opposite condition.
-
[item_accessories]
-
Evaluates to the value of the Accessories database entry for
the item.
-
[item_code]
-
Evaluates to the product code for the current item.
-
[item_data database fieldname]
-
Evaluates to the field name fieldname in the arbitrary database
table database, for the current item.
-
[item_description]
-
Evaluates to the product description (from the products file)
for the current item.
-
[item_field fieldname]
-
Evaluates to the field name fieldname in the database, for
the current item.
-
[item_increment]
-
Evaluates to the number of the item in the match list. Used
for numbering search matches or order items in the list.
-
[item_link code]
-
Expands into a hyperlink which will jump the user to a page
under the ItemLinkDir (default is the pages directory),
with anchor text as set in ItemLinkValue (default is ``More Details'').
If the page is not present, then flypage.html will be used to build
a page from the entry in the database. If that doesn't work (perhaps
due to a missing flypage.html) then the error page notfound.html will
be displayed. Only active in the search list.
-
[item_modifier attribute]
-
Evaluates to the modifier value of attribute for the current item.
-
[item_price n*]
-
Evaluates to the price for quantity
n
(from the products file)
of the current item.
-
[item_quantity]
-
Evaluates to the quantity ordered for the current item.
-
[item_subtotal]
-
Evaluates to the subtotal (quantity * price) for the current item.
Quantity price breaks are taken into account.
.
-
[loop item,item,item] value [/loop]
-
Returns a string consisting of the value, repeated for every item in a
comma-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.
Limited to 1024 values in the list. Iteratively interprets the
following tags:
-
[if_data database fieldname] or [if_loop_data database fieldname]
-
If the arbitrary database field fieldname is non-blank, the following
text up to the [/if_data] tag is substituted. This can be used to
substitute IMG or other tags only if the corresponding source
item is present. Also accepts a [else]else text[/else] pair
for the opposite condition.
-
[if_field fieldname] or [if_loop_field fieldname]
-
If the product database field fieldname is non-blank, the following
text up to the [/if_field] tag is substituted. This can be used to
substitute IMG or other tags only if the corresponding source
item is present. Also accepts a [else]else text[/else] pair
for the opposite condition.
-
[loop_accessories]
-
Evaluates to the value of the Accessories database entry for
the item.
-
[loop_code]
-
Evaluates to the product code for the current item.
-
[loop_data database fieldname]
-
Evaluates to the field name fieldname in the arbitrary database
table database, for the current item.
-
[loop_description]
-
Evaluates to the product description (from the products file)
for the current item.
-
[loop_field fieldname]
-
Evaluates to the field name fieldname in the database, for
the current item.
-
[loop_increment]
-
Evaluates to the number of the item in the list. Used
for numbering items in the list.
-
[loop_price n*]
-
Evaluates to the price for optional quantity n (from the products file)
of the current item.
.
-
[matches]
-
Replaced with the range of match numbers displayed by the
search page. Looks something like ``1-50''. Make sure
you insert this item between a [more_list] and [/more_list]
element pair.
-
[modifier_name attribute]
-
Evaluates to the name to give an input box in which the
customer can specify the modifier to the ordered item.
-
[more]
-
Inserts a series of hyperlinks that will call up the next matches
in a series. They look like this:
Previous 1 2 3 4 5 6 Next
The current page will not be a hyperlink. Every time the new
link is pressed, the list is re-built to correspond to the current
page. If there is no Next or Previous page, that link
will not be shown.
See the fr_resul.html or search.html files for examples. Make sure
you insert this item between a [more_list] and [/more_list] element pair.
-
[more_list]
-
Starts the section of the search page which is only displayed
if there are more matches than specified in mv_matchlimit.
If there are less matches than the number in mv_matchlimit, all
text/html between the [more_list] and [/more_list] elements is
stripped.
Use in conjunction with the [more] element to place pointers to
additional pages of matches.
-
[msql array] SQL [/msql]
-
A complete array of arrays, suitable for eval by Perl, can be returned
by this query. This tag pair encloses any valid mSQL query, and returns
the results (if any) as a string representing rows and columns, in Perl
array syntax. If placed in an embedded Perl area as:
[perl]
my $string =<<'EOF';
[msql array]select * from arbitrary where code <= '19'[/msql]
EOF
my $ary = eval $string;
my $out = '';
my $i;
foreach $i (@$ary) {
$out .= $i->[0];
$out .= "
";
}
$out;
[/perl]
NOTE: The 'EOF' string terminator must START the line, and not
have trailing characters. DOS users, beware of carriage returns!
-
[msql hash] SQL [/msql]
-
A complete hash of hashes, suitable for eval by Perl, can be returned
by this query. This tag pair encloses any valid mSQL query, and returns
the results (if any) as a string representing rows and columns, in Perl
associative array, or hash, syntax. If placed in an embedded Perl area as:
[perl]
my $string =<<'EOF';
[msql hash]select * from arbitrary where code <= '19'[/msql]
EOF
my $hash = eval $string;
my $out = '';
my $key;
foreach $key (keys %$hash) {
$out .= $key->{field1};
$out .= "
";
}
$out;
[/perl]
-
[msql html] SQL [/msql]
-
This tag returns a set of HTML table rows with bold field names at
the top, followed by each row in a set of table cells. The <TABLE>
and </TABLE> tags are not supplied, so you can set your own border
and shading options. Example:
[msql html]select * from arbitrary where code > '19' order by field2[/msql]
-
[msql list SQL] list [/msql]
-
This tag differs from the rest in that it passes the query enclosed
inside the tag itself. The enclosed text is then evaluated with the
same method as with a search list, with data items (in columns) iterated
over for the contents of a list. The following snippet will place
a three-column list in an HTML table:
SKU | Description | Price |
[msql list
select * from arbitrary where code > '19' order by field2 ]
---|
[page [msql-code]][msql-code] |
[msql-param 1] |
[msql-param 2] |
[/msql]
It uses the same tags as in the [loop_list], except prefixed
with msql. Available are the following, in order of interpolation:
[msql_param n] Field n of the returned query (in the row)
[if_msql_field fld] Returns enclosed text only product field not empty
[/if_msql_field] Terminator for above
[if_msql_data db fld] Returns enclosed text only if data field not empty
[/if_msql_field] Terminator for above
[msql_increment] Returns integer count of row
[msql_code] The first field of each row returned
[msql_data db fld] Database field for [msql_code]
[msql_description] Product description for [msql_code]
[msql_field fld] Product field for [msql_code]
[msql_link] Same as item-link
[msql_price q*] Price for [msql_code], optional quantity q
-
[msql param] SQL [/msql]
-
A list of keys, or in fact any mSQL fields, can be returned as a set of
parameters suitable for passing to a program or list primitive. This tag pair
encloses any valid mSQL query, and returns the results (if any) as a series of
space separated fields, enclosed in quotes. This folds the entire return
into a single row, so it may be used as a list of keys.
-
[msql set] SQL [/msql]
-
Any arbitrary SQL query can be passed with this method. No return
text will be sent. This might be used for passing an order to an
order database, perhaps on the order report or receipt page. An
example might be:
[msql set]
insert into orders
values
('[value mv_order_number]',
'[value name escape]',
'[value address escape]',
'[value city escape]',
'[value state escape]',
'[value zip escape]',
'[value phone escape]',
'[item-list]
Item: [item-code] Quan: [item-quantity] Price: [item-price]
[/item-list]'
)
[/msql]
The values entered by the user are escaped, which prevents errors if
quote characters have slipped into their entry.
-
[nitems cart*]
-
Expands into the total number of items ordered so far. Takes an
optional cart name as a parameter.
-
[order code page*]
-
Expands into a hypertext link which will include the specified
code in the list of products to order and display the order
page. code should be a product code listed in the ``products''
database.
-
[page pg]
-
Insert a hyperlink to the specified catalog page pg. For
example, [page shirts] will expand into <
a href=``http://machine.company.com/cgi-bin/vlink/shirts?WehUkATn;;1''>. The
catalog page displayed will come from ``shirts.html'' in the
pages directory.
-
[pagetarget pg frame]
-
Same as the page element above, except it specifies an output frame to
target if frames are turned on. The name is case-sensitive, and if
it doesn't exist a new window will be popped up. This is the same as
the [page ...] tag if frames are not activated.
For example, [pagetarget shirts main] will expand into a link like <a
href=``http://machine.company.com/cgi-bin/vlink/shirts?WehUkATn;;1'' TARGET=``main''>.
The catalog page displayed will come from ``shirts.html'' in the
pages directory, and be output to the 'main' frame. Be careful,
frame names are case-sensitive.
This option also allows specification of secure pages if the target ends with
the string __secure (which will be stripped). If so specified,
the page will be called with SecureURL instead of VendURL.
-
[perl args] code [/perl]
-
See the section on Embedded Perl Code. The args are one of the following:
=item values
Gives read-write access to the user variables, including
the MiniVend special variables, an anonymous hash.
Referred to in your code as %values.
=item items
Gives read-only access to the items on order. This
is an array of hashes, and includes the product
code, quantity, and any modifiers you have specified.
Referred to in your code as a reference to the
array, $items.
=item scratch
Gives read-write access to the scratch variables, an
anonymous hash. Referred to in your code as %scratch.
=item config
Gives read-write access to the configuration of the
catalog. USE WITH EXTREME CAUTION -- many of the
variables are references to anonymous arrays and
hashes. You can crash your catalog if you modify
the wrong thing. Referred to in your code as $config,
a reference to the hash containing the configuration
structure.
=item discount
Gives read-write access to session discounts, an
anonymous hash. Referred to in your code as %discounts.
=item browser
The browser string from the users browser, read-only. Referred
to in your code as $browser.
=item frames
The true/false value determining whether frames
processing is enabled. Read-only -- you can set
the value with [frames-off] or [frames-on]. Referred
to in your code as $frames.
=item file
If specified, the anchor text should be a file name
to read the Perl code from. This allows code to be maintained
in separate files. The file name is relative to the MiniVend
base directory unless specified as an absolute path.
-
[price code]
-
Expands into the price of the product identified by code as
found in the products database.
-
[process_search]
-
Calls the search with the proper URL, including MiniVend session tags. Used
as the ACTION value for the search form.
-
[process_target frame]
-
Calls the search with the proper URL, including MiniVend session tags.
Used as the ACTION value for the search form if the results are to be
targeted to a different window than the one set by SearchFrame (which is
``_self'' by default).
-
[quantity_name]
-
Evaluates to the name to give an input box in which the
customer can enter the quantity to order.
-
[random]
-
Selects from the predefined random messages, and is stripped if none
exist. See Controlling Page Appearance.
-
[row nn]
-
Formats text in tables. Intended for use in reports or <PRE></PRE> HTML
areas. The parameter nn gives the number of columns to use. Inside the
row tag, [col param=value ...] tags may be used.
-
[salestax]
-
Expands into the sales tax on the subtotal of all the
items ordered so far. If there is no key field to derive the
proper percentage, such as state or zip code, it is set to whatever
the default is. See Sales Tax for more information.
-
[search_list]
-
Starts the representation of a search list. MiniVend tags can be
embedded in the search list, yielding a table or formatted
list of items with part number, description, price, and hyperlinks to
order or go to its catalog page.
This is very similar to the [item-list] and on-the-fly page,
except that the code used is the first string in a series of
delimited fields in a record. The return delimiter is normally
a TAB, but can be set to almost any value with mv_return_delim
or mv_index_delim.
The interpreted tags include:
-
[if_data fieldname]
-
If the arbitrary database field fieldname is non-blank, the following
text up to the [/if_data] tag is substituted. This can be used to
substitute IMG or other tags only if the corresponding source
item is present. Also accepts a [else]else text[/else] pair
for the opposite condition.
-
[if_field fieldname]
-
If the product database field fieldname is non-blank, the following
text up to the [/if_field] tag is substituted. This can be used to
substitute IMG or other tags only if the corresponding source
item is present. Also accepts a [else]else text[/else] pair
for the opposite condition.
-
[item_code]
-
Evaluates to the code for the current record -- it is the first parameter
returned in the search, if there are multiple fields. You can set the
order of field return with mv_return_fields.
-
[item_data database fieldname]
-
Evaluates to the field name fieldname in the arbitrary database
table database, for the current item.
-
[item_description]
-
Evaluates to the product description (from the products file)
for the current item.
-
[item_field fieldname]
-
Evaluates to the field name fieldname in the product database, for
the current item.
-
[item_increment]
-
Evaluates to the number of the item in the match list. Used
for numbering search matches or order items in the list.
-
[item_link code]
-
Expands into a hyperlink which will jump the user to a page
under the ItemLinkDir (default is the pages directory),
with anchor text as set in ItemLinkValue (default is ``More Details'').
If the page is not present, then flypage.html will be used to build
a page from the entry in the database. If that doesn't work (perhaps
due to a missing flypage.html) then the error page notfound.html will
be displayed.
-
[item_price n*]
-
Evaluates to the price for quantity
n
(from the products file)
of the current item.
.
-
[selected var_name value]
-
This will output CHECKED if the variable var_name is equal to
value
. Not case sensitive.
-
[set variable]value[/set]
-
Sets a scratchpad variable to
value
. One way this is used is to
save pages that a customer has seen -- perhaps for a rotating message.
A rotating message implementation is shown in the sample page flypage.html.
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.
-
[shipping_description]
-
The text description of the shipping mode currently selected.
-
[static /html/path] static-area [/static]
-
Defines an area (usually an item, loop, or search list) that
will be built with HREFs to regular pages instead of to the
MiniVend server. Search, scan, and order URLs will still be
made to go to the CGI. Use in conjunction with Cookies and
StaticPath to allow access to static page trees from MiniVend.
This can increase system capacity on heavily-trafficked systems.
-
[subtotal]
-
Expands into the subtotal cost, exclusive of sales tax, of
all the items ordered so far.
-
[total_cost]
-
Expands into the total cost of all the items ordered so far, including
sales tax (if any).
-
[value field flag*]
-
Expands into the current value of the customer input field
named by field. If flag is present, single and double
quotes will be escaped with a backslash; this allows reliable
SQL inserts. See the section on input fields for more
information.