NOTE: This section is appropriate for MiniVend 3.09 and above.
You may specify a search inside a page with the [search parameters*] or
[search_region parameters*] tag. The parameters are the same as the the one-click search, and the
output is always a newline-separated list of the return objects -- by
default a series of item codes.
The [loop ...] tag directly accepts a search parameter. To search for all products in the
categories ``Americana'' and ``Contemporary'' you can do:
[loop search="
se=Americana
se=Contemporary
os=yes
sf=category9
"]
Artist: [loop-field artist]<BR>
Title: [loop-field title]<P>
[/loop]
The advantage of the in-page search is that you can embed searches within searches, and you can have straight unchanging links from static HTML pages.
The syntax is a bit tricky because of the
HTML style evaluation and the = signs in both argument types, so you may want to pre-set the search
arguments with a search profile. Any string passed to the search tag that
doesn't contain an equals (=) sign is considered a search profile name. Example:
[set My search]
mv_searchspec=Americana
mv_searchspec=Contemporary
mv_search_field=category
mv_orsearch=yes
[/set]
Now doing a search with [search My search] or [loop search="My search"]
will use the above settings.
If you want to use the shorthand ``se=Americana'' notation, you can set the special scratch variable mv_search_arg:
[set mv_search_arg]
se=Americana
se=Contemporary
sf=category
os=yes
[/set]
A search with empty parameters, as in [search] or [loop search=""], will yield the same results. (You must define an empty string with quote
marks for the second notation -- [loop search=] will not work.)
To place an in page search with the full range of display in a normal
results page, use the [search-region] tag the same as above, except that you can place [search-list], [more-list], and [more]
tags within it and use them to display and format the results -- including
paging.
For example:
[search-region se=Americana
sf=category
ml=2
]
[more-list][more][/more-list]
[search-list]
<A MV="page [item-code]" HREF="flypage.html">
[item-field title]<A>, by [item-field artist]
[/search-list]
[no-match]
Sorry, no matches for [value mv_searchspec].
[/no-match]
[/search-region]
If you want to use the same page for search paging, make sure you set the sp=page parameter.