Miva Merchant 4 Module FAQs » Search Manager (BROK_SEARCH)


Can I display PAGES LINKS for Search Results

I want to display paging links on the search results page.

(NOTE: this feature can slow down the search process if you have many products in your store. In order to build the list of pages, the module obviously needs to determine how many pages of results there are by searching the entire database. If there are many products this can take awhile)

The module is capable of displaying a list of the pages of search results as links to the various pages (with the current page NOT being a link). It requires that you use the "Use template formatting" option (on the module's 'Options' tab).

The %paging% token can be used in the main template area to display an "index" to pages of results. For example, if there are 6 pages of results and your customer is currently on page 3 the %paging% token would be replaced with something like:

1 2 [3] 4 5 6

with each number being a "quick link" to that page.

There are three template areas at the very bottom of the template's configuration page. The template area labelled "templage for 'this page'" is the template used to replace the number of the page that the customer is currently on. The token %number% is replaced with the page number but you can also have the pages represented by letters by using the tokens %smallalpha% (replaced with a lower case letter, i.e. the pages would be lettered a b c d e etc.) or %largealpha% (replaced with upper case letter, i.e. A B C D). By default, this template has the text [%number%] in it and displays as in the above example.

The field labeled "template for 'other pages'" is used to display the characters for the other pages (i.e. those that the customer is not currently on and are linked to other pages). The same tokens can be used in this field (i.e. %number%,%smallalpha%, %largealpha%).

An example of use of this feature can be seen by simply adding the token %paging% to the top of the Main template area.

A more refined example:

<table cellpadding="2"><tr>
<td>Pages:</td> %paging%


to the main template area above the table which displays the results. and for the other "this page" area use:


And for the "other page" area use:


The third field for the %paging% feature is labelled 'row template'. This is used for displaying the list of pages in some other manner than a simple horizontal row (for example, in a "grid" 4 links across).

By default the row template (in the "Results Paging" section of the "template" tab) contains a single token %page|01|%. When the %paging% token is processed, it is done a "row" at a time with multiple copies of the "row template". The token %page|xx|% will be replaced by either the "template for 'this page'" or the "template for 'other pages'" depending on whether or not the current page is the "this page". Since the default "row template" contains only the single token %page|01|%, the %paging% token will simple be replaced with a string of copies of the "page" templates. For example, if your "template for 'this page'" is [%number%] and the "template for 'other pages'" is %number%, then the %paging% token would display something like:

1 2 3 [4] 5 (i.e. %number%%number%%number%[%number%]%number).

So, to display a "table" of page numbers, say 4 numbers to a row, you would put <table></table> tags around the %paging% token:


Then change the "row template" to contain a row of the table:


If there are 8 products in the results (with the same tokens in the page templates as above), this will result in html something like:





Last update: 2005-07-27 18:01
Author: Support
Revision: 1.0

Print this record Send FAQ to a friend Show this as PDF file
Please rate this FAQ:

Average rating: 0 out of 5 (0 Votes )

completely useless 1 2 3 4 5 most valuable

You cannot comment on this entry

Records in this category