XAO::DO::Web::MultiPageNav - Multi page navigation display
Currently is only useful in XAO::Web site context.
The 'MultiPageNav' object is a part of some 'Search' object that displays a header template, a search results template for each search result, and a footer template. The header and footer templates includes MultiPageNav object. There are three parameters available for substitution: START_ITEM, ITEMS_PER_PAGE and TOTAL_ITEMS. These parameters can be used to display subsequent links with the MultiPageNav object
The parameters for the MultiPageNav object are defined as follows:
Note: count of first item of first page is 1.
Maximum number of items per page
Total number of items
Maximum number of first few and last few numbered page links
Maximum number of numbered page links immediately preceding and following current page
Maximum number of numbered page links in blocks between 'edge' and 'adjacent' links
Maximum number of page link blocks (not including 'edge' and 'adjacent' links)
Minimum number of pages between blocks
Path to template for displaying link to previous page
Path to template for display when there is no previous page
Path to template for displaying link to next page
Path to template for display when there is no next page
Path to template for displaying (non)link to current page
Path to template for displaying link to numbered pages
Path to template for displaying spacer between numbered page links
Path to template for displaying all multi-page nav links
The 'MultiPageNav' object performs all necessary calculations and template substitutions (using xxx.path templates). The values for these parameters so that a list of parameters is available to the 'path' template. The values for this parameters correspond to the navigation display content. Following is a listing of said parameters with a description of thier values' display contents:
Link to previous page
Links to first few pages
Blocks of links to pages between first few and previous adjacent pages includingspacers
Links to pages immediately preceding current page
(Non)link to current page
Links to pages immediately following current page
Blocks of links to pages between next adjacent and last few pages including spacers
Links to last few pages
Link to next page
The CGI parameters that are necessary for creating links in the 'xxx.path' templates are available via XAO::DO::Web::Utility object. Also, the following parameters available to these templates:
The count of the first item to appear on the page the link points to
The page number the link points to
Type of page the link points to. Values can be PREVIOUS, FIRSTFEW, PREVIOUS_BLOCKS, PREVIOUS_ADJACENT, CURRENT, NEXT_ADJACENT, NEXT_BLOCKS, LASTFEW, NEXT
This example shows how a header or footer template might use this object:
<%MultiPageNav start_item="<%START_ITEM%>" items_per_page="<%ITEMS_PER_PAGE%>" total_items="<%TOTAL_ITEMS%>" n_adjacent_pages="2" n_edje_pages="3" n_block_pages="2" max_blocks="4" min_period="7" path="/bits/multi_page_nav/base" previous_page.path="/bits/multi_page_nav/prev" next_page.path="/bits/multi_page_nav/next" current_page.path="/bits/multi_page_nav/current" numbered_page.path="/bits/multi_page_nav/page" spacer.path="/bits/multi_page_nav/spacer" %>
File /bits/multi_page_nav/page contents:
<A HREF="/search.html?<%Utility mode="pass-cgi-params" params="*" except="start_item" result="query" %>&start_item=<%PAGE_START_ITEM%>"><%PAGE_NUMBER%></A>
File /bits/multi_page_nav/prev contents:
<A HREF="/search.html<%Utility mode="pass-cgi-params" params="*" except="start_item" result="query" %>&start_item=<%PAGE_START_ITEM%>"><<prev</A>
File /bits/multi_page_nav/spacer contents: ...
File /bits/multi_page_nav/current contents:
[<%PAGE_NUMBER%>]
File /bits/multi_page_nav/base contents:
<%PREVIOUS%> <%FIRSTFEW%> <%PREVIOUS_BLOCKS%> <%PREVIOUS_ADJACENT%> <%CURRENT%> <%NEXT_ADJACENT%> <%NEXT_BLOCKS%> <%LASTFEW%> <%NEXT%>
If the value of START_ITEM, ITEMS_PER_PAGE and TOTAL_ITEMS are 250, 10 and 500 respactively text representation result of this example looks like
<<prev 1 2 ... 11 12 ... 22 23 24 [25] 26 27 28 ... 38 39 ... 49 50 next>>
No publicly available methods except overriden display()
Nothing
Copyright (c) 2001 XAO, Inc.
Recommended reading: XAO::Web, XAO::DO::Web::Page, XAO::DO::Web::CgiParam, XAO::DO::Web::Utility.
To install XAO::Web, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XAO::Web
CPAN shell
perl -MCPAN -e shell install XAO::Web
For more information on module installation, please visit the detailed CPAN module installation guide.