[tony@kasei.com - Fri Dec 17 14:05:05 2004]:
Show quoted text> On Thu, Dec 16, 2004 at 01:31:23PM -0500, Guest via RT wrote:
> > When the list passed to Pagination is a list of hash ref's, and
when
Show quoted text> > page.page_data should contain just one array element (a single
hash ref),
Show quoted text> > instead it contains an array of all the keys and values of the
hash.
Show quoted text> > This also happens if the list itself that is passed to Pagination
is a
Show quoted text> > single hash ref.
>
> Can you supply a test script?
>
> Tony
I replied to the email but it doesn't look like it posted here
correctly so here it is again.... This is a template toolkit template
page.
-----------------------------------
[% IF params.pagenum < 1 %]
[% params.pagenum = 1 %]
[% END %]
[% list = [] %]
[% USE DBI %]
[% FOREACH item = DBI.query( "SELECT * FROM poi2_products" ) %]
[% list.push(item) %]
[% END %]
[% USE page = Pagination(list, params.pagenum, 20) %]
[% FOREACH item IN page.page_data.sort %]
[% item.sku %]<BR>
[% END %]
[% UNLESS params.pagenum == 1 %]
<a href="[%params.catalog_url%]/page.html?pagenum=[% page.first_page
%]">First</a>
<a href="[%params.catalog_url%]/page.html?pagenum=[%
page.previous_page %]">Previous</a>
[% END %]
[% UNLESS params.pagenum >= page.last_page %]
<a href="[%params.catalog_url%]/page.html?pagenum=[% page.next_page
%]">Next</a>
<a href="[%params.catalog_url%]/page.html?pagenum=[% page.last_page
%]">Last</a>
[% END %]
<BR><BR>
Entries [%page.first%] - [%page.last%] of [%page.total_entries%]<BR>
First page: [% page.first_page %]
Prev page: [% page.previous_page %]
Current page: [% page.current_page %]
Next page: [% page.next_page %]
Last page: [% page.last_page %]