5.12. The Results Page

Once a search has been completed, there needs to be a way of presenting the output. By default, the SpecialPage search is used. It is set to results in the distribution demo, but any number of search pages can be specified by passing the value in the search form specified in the variable mv_search_page.

On the search page, some special Interchange tags are used to format the otherwise standard HTML. Each of the iterative tags is applied to every code returned from the search. This is normally the product code, but could be a key to any of the arbitrary databases. The value placed by the [item-code] tag is set to the first field returned from the search.

The basic structure looks like this:

[search-region]
[search-list]
    your iterating code, once for each match
[/search-list]
[no-match]
    Text / tags to be output if no matches found (optional but recommended)
[/no-match]
[more-list]
    More / paging area (optional)
[/more-list]
[/search-region]

Tip for catalogs upgraded from Minivend 3: A [search-list][/search-list] must always be surrounded by a [search-region][/search-region] pair. This is a change from Minivend 3.

[search-list]

            [search-region prefix=my]
            [search-list]
                SKU:   [my-code]
                Title: [my-data products title]
            [/search-list]
            [/search-region]
         [item-alternate N] true [else] false [/else] [/item-alternate]
         [if-item-param named_field] true [else] false [/else] [/if-item-param]
         [item-param named_field]
         [if-item-pos N] true [else] false [/else] [/if-item-pos]
         [item-pos N]
         [if-item-field products_field] true [else] false [/else] [/if-item-field]
         [item-field products_column]
         [item-increment]
         [item-accessories]
         [item-code]
         [item-description]
         [if-item-data table column] true [else] false [/else] [/if-item-data]
         [item-data table column]
         [item-price N* noformat=1*]
         [item-calc] [/item-calc]
         [item-change marker]
                [condition]variable text[/condition]
                true
                [else] false [/else]
         [/item-change marker]
         [item-last] condition [/item-last]
         [item-next] condition [/item-next]


Note: those that reference the shopping cart do not apply, i.e., [item-quantity], [item-modifier ...] and friends.

[/search-list]

[no-match]

[/no-match]

[sort database:field:option* database:field:option*]

[item-change marker]

         <TABLE>
         <TR><TH>Category</TH><TH>Subcategory</TH><TH>Product</TH></TR>
         [search-list]
         <TR>
            <TD>
                 [item-change cat]
        
                 [condition][item-field category][/condition]
        
                         [item-field category]
                 [else]
                         &nbsp;
                 [/else]
                 [/item-change cat]
            </TD>
            <TD>
                 [item-change subcat]
        
                 [condition][item-field subcategory][/condition]
        
                         [item-field subcategory]
                 [else]
                         &nbsp;
                 [/else]
                 [/item-change subcat]
            </TD>
            <TD> [item-field name] </TD>
         [/search-list]
         </TABLE>

[/item-change marker]

[matches]

[match-count]

[more-list next_img* prev_img* page_img* border* border_current*]

             Previous   <IMG SRC="prev.gif" Border=3>
             Page 1     <IMG SRC="/cgi-bin/page_num.cgi?1">
             Page 2     <IMG SRC="/cgi-bin/page_num.cgi?2">
             Next       <IMG SRC="next.gif" Border=3>
             Previous   <IMG SRC="prev.gif">
             Page 1     <IMG SRC="/cgi-bin/page_num.cgi?1">
             Page 2     <IMG SRC="/cgi-bin/page_num.cgi?2">
             Next       <IMG SRC="next.gif">
             Previous   <IMG SRC="prev.gif" Border=0>
             Page 1     <IMG SRC="/cgi-bin/page_num.cgi?1">
             Page 2     <IMG SRC="/cgi-bin/page_num.cgi?2">
             Next       <IMG SRC="next.gif" Border=0>
            [more-list]
            [first-anchor] First [/first-anchor]
            [next-anchor] Forward | [/next-anchor]
            [prev-anchor] Back [/prev-anchor]
            [last-anchor] Last [/last-anchor]
            [page-anchor] Page $PAGE$ (matches $MINPAGE$-$MAXPAGE$) | [/page-anchor]
            [more]
            [/more-list]
            $PAGE$       Page number
            $MINPAGE$    Minimum match on page
            $MAXPAGE$    Maximum match on page
          [link-template]<a href="$URL$" target="_top">$ANCHOR$</a>[/link-template]
            $URL$      The URL for the 'more' page in question
            $ANCHOR$   The page number or the word "Next" or "Previous"
                           for the link in question.
          Previous 1 2 3 4 5 6 7 8 9 10 [more>>] Next
          Previous [<<more] 11 12 13 14 15 16 17 18 19 20 [more>>] Next
          Previous (lower) 11 12 13 14 15 16 17 18 19 20 (higher) Next

[/more-list]

[more]

            Previous 1 2 3 4 5 6 Next

[process-search]