[Petal] Reengineering of HTML::Pager

William McKee william@knowmad.com
Wed, 16 Oct 2002 09:38:10 -0400


On 16 Oct 2002 at 12:18, Jean-Michel Hiver wrote:
> Mind you it is hard to write a very generic pager I think. For instance I'm
> doing paging for our new discussion forum, but the paging is also combined
> with message threading, which spices things up a little bit.

Yeah, that is kind of a problem with this module. It basically gives you 
the look and feel of Google's next/prev/jumpto bar at the bottom w/o the 
graphics. Now that I think about it, it wouldn't be too hard to add the 
ability to insert your own markup for a more custom look. For me, the 
benefits of having it encapsulated as a module are that it captures a 
simple technique for paging results (courtesy of Sam Tregar) and makes it 
easy to drop-in a solution for a common problem.


> # template discussion/list/thread.en.html

Thanks for the examples. If I'm reading your code correctly, this part is 
readily handled by my template. HTML::Pager handles splitting the data, 
returning the relevant records, building the navigation bar, and marking 
the current position. Perhaps I'm not understanding the message threading 
component which is admittedly more than the Pager is meant to handle.


> # template discussion/list/navigation-bar.en.html 

So what it looks like you're doing here is going to create a bar that 
looks like the following (if there were 6 slices of returned data):
	1|2|3|4|5|6

Is that correct?


> Well, it would be certainly interesting to take a look at it :)

I've sent a copy to you directly to keep from flooding the list. If anyone 
else wants a copy let me know.


William

-- 
 Lead Developer
 Knowmad Services Inc. || Internet Applications & Database Integration
 http://www.knowmad.com