Template::Plugin::Pageset - wrapper for Data::Page::Pageset
# pager is a Data::Page object [% USE pageset = Pageset( pager ) %] # pages_per_set is using default 10 [% USE pageset = Pageset( pager, 7 ) %] # pages_per_set is 7 [% USE pageset = Pageset( pager, { pages_per_set => 12 } ) %] # set max_pagesets to be 12 [% USE pageset = Pageset( pager, { max_pagesets => 4 } ) %] # set max_pagesets to be 4
[% IF pageset.previous_pageset %] <a href="JavaScript:goto_page('[% pageset.previous_pageset.middle %]');">Previous Pageset</a> [% END %] [% FOREACH chunk = pageset.total_pagesets %] [% IF chunk.is_current %] [% FOREACH num = [ chunk.first .. chunk.last ] %] [% IF num == pager.current_page %] <b>[% num %]</b> [% ELSE %] <a href="JavaScript:goto_page('[% num %]');">[% num %]</a> [% END %] [% END %] [% ELSE %] <a href="JavaScript:goto_page('[% chunk.first %]');">[% chunk %]</a> [% END %] [% END %] [% IF pageset.next_pageset %] <a href="JavaScript:goto_page('[% pageset.next_pageset.middle %]');">Next Pageset</a> [% END %]
Data::Page::Pageset is the core one, more methods see that pod.
Chun Sheng, <me@chunzi.org>
Copyright (C) 2004-2005, Chun Sheng
This module is free software; you can redistribute it or modify it under the same terms as Perl itself.
To install Template::Plugin::Pageset, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Template::Plugin::Pageset
CPAN shell
perl -MCPAN -e shell install Template::Plugin::Pageset
For more information on module installation, please visit the detailed CPAN module installation guide.