[Catalyst] Re: OT: Better TT pager?

Oliver Charles oliver.g.charles at googlemail.com
Fri Jan 23 19:31:37 GMT 2009

On 23 Jan 2009, at 15:00, Jesse Sheidlower wrote:
> I like this quite a bit, more than some of the other solutions
> which I tried, and think I'll use this.

Glad you like it :)

> One question, from an arithmetically-challenged one: How would
> I modify this to allow the user to skip by, say, tens? If you
> have a search with 1000 pages, you can only go to the
> beginning or end, but getting to the middle would be
> unbearably tedious (it would be only slight less tedious
> having to do it be tens, but still better).

Well, it really depends on how you want to display the results. But I  
guess you'd do some kind of loop, doing (i * 10) to get the multiples  
of 10 - the just looping until you exceed total_pages. However, this  
is really getting a bit more complex than should be in a template  
(arguably, even my template is too complex) - so you should look to  
maybe subclass Data::Page to do this for you.
> Jesse Sheidlower
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/

More information about the Catalyst mailing list