[pmwiki-users] paging

Martin Fick mogulguy at yahoo.com
Sat Jul 29 22:14:58 CDT 2006


--- Kathryn Andersen
<kat_lists at katspace.homelinux.org> wrote:
> Say your signups page is called "Signups"
> 
> You could make a page "Signups1" which contains
> 
> (:include Signups lines=1..100:)
> 
> This would display the first 100 lines of the
> Signups page.
> 
> And another page "Signups2" which contains
> 
> (:include Signups lines=101..200:)
> 
> You would have to create each one by hand, which
> really doesn't save you
> much effort, and there would still be this huge
> Signups page.

Ahh, take this idea and use the HttpVariables recipe
and you can do the same thing on onepage!  Simply pass
the start and end arguments as url (GET) variables.  

To reference the first one hundred lines:

[[(Signups)Pager?Start=1&End=100]]

And on SignupsPager you put:

(:include Signups lines={$!Start}..{$!End}:)


The hard part now becomes creating the proper links
for the previous and next pages!  (Again, another use
for a math recipe)  But this would also be hard if you
had Signups1, Signups2...  At least now you can do all
the logic on one page.  Here is some sample logic:

(:if equal {$!Start} 1:)
[[Next -> SignupsPager?Start=101&End=200]]
(:if equal {$!Start} 2:)
[[Next -> SignupsPager?Start=201&End=300]]
...
(:if:)

Use similar logic for prev.  The really hard part is
knowing how long the page is to know at what number to
stop at!

-Martin


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




More information about the pmwiki-users mailing list