Index  Up  <<  >>  


Basic MiniVend Tags

NOTE: In the descriptions, parameters marked with an asterisk* are optional.

When a tag is separated by an underscore, as in item_list, a dash is just as appropriate (i.e. item-list). They are interchangeable, except that the ending tag and beginning tag should match (don't use [item-list] list [/item_list]). * indicates an optional argument

[value name=field escaped=1 set="new value" hide=1]
positional: [value field]

HTML examples:

   <PARAM MV="value name">
   <INPUT TYPE="text" NAME="name" VALUE="[value name]">

Expands into the current value of the customer/form input field named by field.If the set value is present, the form variable value will be set to it and the new value returned. Use this to ``uncheck'' a checkbox or set other form variable values to defaults. If HIDE is set, the value will be set but not returned to the page.

If escaped is 1, single quotes will be escaped with a backslash; this allows you to contain the [value ...] tag within single quotes. (It is somewhat better to use other Perl quoting methods like q{[value whatever]}.)

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.

[page ...]
named: [page href=``dir/page'' arg=``argument'' secure=1* form=``form string'']

positional: [page dir/page arg*] (only two positional parameters)

HTML example: <A MV=``page'' MV.HREF=``dir/page'' MV.ARG=``arg''* HREF=``dir/page.html''>

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.

If the user has sent a cookie to MiniVend (meaning the second page they access), and you set the scratch value c<mv_no_session_id> in their session, the session ID will not be appended to the URL. If you set the scratch value mv_no_count, then the page count will not be appended; this is not dependent on cookies. So if you put in your initial page

        [set mv_no_session_id]1[/set]
        [set mv_no_count]1[/set]

no session ID or count will be shown. That makes the URL shown above be http://machine.company.com/cgi-bin/vlink/shirts -- once again, that is on the second page the user accesses if they are taking and sending cookies. If the user has a pre-existing MV_SESSION_ID cookie from a prior session, the effect will be immediate.

The 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 $Safe{'session'}->{arg}. If you set the catalog configuration option NewEscape, which is the default, then spaces and some other characters will be escaped with the %NN HTTP-style notation and unescaped when the argument is read back into the session.

A bit of magic occurs if MiniVend has built a static plain HTML 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 ID.

The optional form argument allows you to encode a form in the link.

        [page form="
                mv_order_item=99-102
                mv_order_size=L
                mv_order_quantity=1
                mv_separate_items=1
                mv_todo=refresh"] Order t-shirt in Large size </A>

The two form values mv_session_id and mv_arg are automatically added when appropriate. (mv_arg is the arg parameter for the tag.)

If the parameter href is not supplied, process is used, causing normal MiniVend form processing. If the href points to an http:// link no MiniVend URL processing will be done, but the mv_session_id

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

You must have TolerateGet set (which is the default) and 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.

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.

You can also use it for submitting foreign forms if you like; it will not touch the href if it begins with http:, ftp:, or the like.

Index  Up  <<  >>