For more information... RTFM!
NAVIGATION
PAGES THAT LINK HERE
ACCOUNT LOGIN

You are not logged in

Powered by Interchange version 5.7.0

more-list

Summary

  • [more-list next_img prev_img page_cgi border_size] ... [/more-list]
  • [PREFIX-more-list next_img prev_img page_cgi border_size] ... [/PREFIX-more-list]

Description

This output control region is used to define a section of the search results output which is only displayed if there are more matches than specified in the "mv_matchlimit".

If there are less matches than the number specified in "mv_matchlimit" then all text/html between the [more-list] and [/more-list] elements will be stripped.

Note

Note

The looping tags that make use of this sub-tag, including [item-list], [loop], [query] and [search-region], each take a "prefix" parameter.  If the "prefix" parameter is specified then this sub-tag must be called using the "[PREFIX-more-list]...[/PREFIX-more-list]" syntax, where "PREFIX" is the value supplied to the loop tag's "prefix" parameter.

If the optional "next", "prev" and "page" parameters are specified, then they are taken to be image files that will be inserted instead of the standard "Next", "Previous" and page numbers.  If "prev" is "none" then no previous link will be output.  If "page" is "none" then no links to pages of matches will be output.  The images filenames are subject to ImageDir rewrites.  Each image will be encased in an <img> tag before being output.

If the "border" parameter is specified then it will be passed to the "<img> tags as the "border" parameter.

If the "page" is specified, and is not "none", then it will be used as described above and will also be passed a URI argument representing the page number that should be shown.  This allows an image generator program to be used to generate page numbers on the fly.  If the "border_selected" parameter is specified then it will be passed to the appropriate page number's "<img> tag as the "border" parameter and can therefore be used to mark the "current page".

Some examples follow:

Input

[more-list next.gif prev.gif /cgi-bin/page_num.cgi 3]
[/more-list]
Causes anchors of

Previous <img src="/images/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="/images/next.gif" border="3">
Input

[more-list next.gif prev.gif /cgi-bin/page_num.cgi]
[/more-list]
Causes anchors of

Previous <img src="/images/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="/images/next.gif">
Input

[more-list next.gif prev.gif /cgi-bin/page_num.cgi 0 0]
[/more-list]
Causes anchors of

Previous <img src="/images/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="/images/next.gif" border="0">
Note

Note

URIs generated for [more-list] page targets will always be encoded to make use of the "scan" ActionMap.  Interchange will, of course, read the correct page according to the original search specification's mv_search_page (sp) parameter, or will use the "results" if no search page was specified for "[more-list] results.

Display template

Availability

Availability

This display template facility was introduced in version 5.5.0, and is therefore not available for use with any earlier Interchange version.

The output of the [more-list] region can be controlled with the sub-tags, listed below, and with the use of the following pre-defined template tokens:

Token Description
{MATCHES} Same as the [matches] sub-tag.
{MATCH_COUNT} Same as the [match-count] sub-tag.
{CURRENT_PAGE} Current page number.
{FIRST_LINK} Link to first page.
{PREV_LINK} Link to previous page.
{NEXT_LINK} Link to next page.
{LAST_LINK} Link to last page.
{MORE_LIST} The page link list.
{LAST_PAGE} Last page number.
{DECADE_FIRST} First page of decade.
{DECADE_LAST} Last page of decade.
{FIRST_MATCH} First match displayed on this page.
{LAST_MATCH} Last match displayed on this page.
{DECADE_PREV} Link to decade previous.
{DECADE_NEXT} Link to next decade.

The following shows a simple [search-region], along with a [more-list] display template:

[search-region]
[search-list]
[item-param sku] - [item-param description]<br>
[/search-list]
[more-list __IMAGE_DIR__/next.gif __IMAGE_DIR__/prev.gif 0 0]
<p>
    {PREV_LINK}
        Page {CURRENT_PAGE} of {TOTAL_PAGES}
    {NEXT_LINK}
</p>
[/more-list]
[/search-region]

A default template will be used unless a token (or suspected token) is found in the [more-list] region's body text.  Interchange will make use of a "{[A-Z][A-Z_]+[A-Z]}" regular expression to check the [more-list] region for template tokens.

The default template can be overridden by passing a "more_template" parameter to the enclosing looping tag or, as noted above, by placing template tokens in the [more-list] region.

The default template is defined to be backwards-compatible with earlier Interchange versions, as follows:

{FIRST_LINK?}{FIRST_LINK} {/FIRST_LINK?}
{PREV_LINK?}{PREV_LINK} {/PREV_LINK?}
{DECADE_PREV?}{DECADE_PREV} {/DECADE_PREV?}
    {MORE_LIST}
{DECADE_NEXT?} {DECADE_NEXT}{/DECADE_NEXT?}
{NEXT_LINK?} {NEXT_LINK}{/NEXT_LINK?}
{LAST_LINK?} {LAST_LINK}{/LAST_LINK?}
Note

Note

Note the use of the conditional display syntax demonstrated by the default template, shown above.  Any text within a "{FOO?}...{/FOO?}" conditional block will only be displayed if the associated "{FOO}" token has a value.

Sub-tags

This tag has sub-tags of its own, which can be used to customise the text that will be displayed when multiple pages of output are generated.  The sub-tags are as follows:

[matches]

Outputs the current range of search matches displayed on this page.  For instance:

[matches]
1-20

[match-count]

Outputs the total number of search matches found, which may be spread over multiple pages.  For instance:

Results [matches] of [match-count] shown
Results 1-20 of 36 shown

[more]

Outputs links to additional pages of search matches.  For instance:

Results [matches] of [match-count] shown
[more]
Results 1-20 of 36 shown
1 2 Next Last

The "1 2 Next Last", in the previous example, would be output as links to other pages of search results.

If mv_more_alpha was set true, in the looping tag's search parameters, then the search results would be grouped by letter instead of by page number.  In that case, the [more] list would look something like the following:

[more]
A B C F K Next Last

The "A" page would contain all results where the key column's value starts with the letter "A".  The same for the "B" page etc.

If mv_more_alpha_chars was also supplied then the specified first few letters will be matched.  The default is 1.  For instance, if mv_more_alpha_chars was specified as 2 then the following might result:

[more]
AA AB AK BU CE FA KE Next Last
Note

Note

If the mv_more_alpha_chars is to produce the expected results, the search results must be sorted by the table's key column.  This can be achieved either with an "ORDER BY clause in your [query] tag's SQL, or by using the mv_sort_field search parameter.

[first-anchor]

Sets the text that will be returned instead of the default "First", if appropriate.

[first-anchor]First[/first-anchor]

[next-anchor]

Sets the text that will be returned instead of the default "Next", if appropriate.

[next-anchor]Next[/next-anchor]

If the "next_img" parameter is specified as a non-zero value then the [next-anchor] value will be ignored, and the following will be used in its place:

<img src="$next_img">

Where $next_img is the value of the "next_img" parameter.  If a "border" parameter is specified then a "border="$border"" parameter will be passed to the above HTML "<img>" tag.

[prev-anchor]

Sets the text that will be returned instead of the default "Previous", if appropriate.

[prev-anchor]Previous[/prev-anchor]

If the "prev_img" parameter is specified as a non-zero value then the [prev-anchor] value will be ignored, and the following will be used in its place:

<img src="$prev_img">

Where $prev_img is the value of the "prev_img" parameter.  If a "border" parameter is specified then a "border="$border"" parameter will be passed to the above HTML "<img>" tag.

[last-anchor]

Sets the text that will be returned instead of the default "Previous", if appropriate.

[last-anchor]Last[/last-anchor]

[decade-next] and [decade-prev]

If have many pages of matches and don't want to have them all displayed at once, in a big list, you can use these sub-tags, as follows:

[decade-next] [Next 10 &gt;&gt;] [/decade-next]
[decade-prev] [&lt;&lt; Previous 10] [/decade-prev]

If these tags are used, but are empty (i.e. "[decade-next][/decade-next]") then the default text will be used.  The [decade-next] default text is "[more>>]", and the [decade-prev] default text is "[<<more]".

The above example will output text that reads like the following for pages 1 through 10:

Previous 1 2 3 4 5 6 7 8 9 10 [Next 10 >>] Next

Pages 11 through 20 will output text that reads like the following:

Previous [<< Previous 10] 11 12 13 14 15 16 17 18 19 20 [Next 10 >>] Next

Of course, image-based anchors can be used as well.

[page-anchor]

Sets the HTML that will be output as a link to further pages of search results.  For instance:

[first-anchor] Forward | [/first-anchor]
[first-anchor] Back [/first-anchor]
[page-anchor] Page $PAGE$ (matches $MINPAGE$-$MAXPAGE$) | [/page-anchor]

The above will produce output that reads like the following:

Forward | Page 1 (matches 1-50) | Page 2 (matches 51-77) | Back

The "$PAGE$" marker will be replaced with the target page number, and the above will produce output that reads like the following:

The following markers are replaced within the [page-anchor] text:

Marker Description
$PAGE$ Target page number.
$MINPAGE$ First result number shown on the target page.
$MAXPAGE$ Last result number shown on the target page.

[link-template]

This sub-tag can be used to customise the HTML hyperlink, and is useful for adding a JavaScript "onclick" attribute, a CSS style or forcing the link target to use a different window, etc. For instance:

[link-template]<a href="$URL$" target="_top">$ANCHOR$</a>[/link-template]

The following markers are replaced within the [link-anchor] text:

Marker Description
$URL$ The auto-generated URI that will be used to link to the target page.
$ANCHOR$ The page number, or words such as "Next" or "Previous", as appropriate.  The words are affected by the other available sub-tags, such as [first-anchor] etc.

See also

Last modified by: Kevin Walsh
Modification date: Thursday 21 June 2007 at 2:21 PM (EDT)
Home  |  Legal nonsense  |  Privacy policy  |  Donations  |  Contact us