[pmwiki-users] 2.2.0-beta36 release (pagelist template updates)

Martin Fick mogulguy at yahoo.com
Wed Apr 18 18:07:08 CDT 2007


--- "Patrick R. Michaud" <pmichaud at pobox.com> wrote:
> > Will you consider adding something to help
> > complete paging support now?  ...

> I'm still looking into this, but my feeling is that
> the "math recipe" approach is overkill (and over
> complex).
> 
> > Examples of how to page by ten using {$?get_var}
> > and $((math_expression)) as sample notations:
> > 
> >  (:template default size=10 
> >    count={$?beg}..$(({$?beg} + {$$size})) :)
> 

What if we used a pagelist specific notation for
paging that did not involve doing explicit math,
something like this:

  (:pagelist size=20:)

Accessing the next and previous links could be done
with a simple [[<]] [[>]].  Or, if more than one
pagelist on the page, an id could be assigned:

  (:pagelist size=20 id=pl1:)

   [[pl1< | Prev ]] [[pl1> | Next ]]

The [[<]] and [[>]] would evaluate to the proper link
to get the prev and next results using the default
size of the pagelist.  The implementation of this
could be hidden from the user, perhaps a session
variable or a cookie or even a get var (not as good
when a user browses off the page or there are multiple
pagelists on a page).

This would provide rudimentary paging but on its own
would not allow the creation of a series of links like
this:

  << < '20' 40 60 80 100 ...> >>

Something like the above would ideally be done with a
pagelist template itself so that it could be formatted
however the user wanted.  This would probably require
some additional conditionals to pull off.  Perhaps
something like this:

  [[#plseries]]
  (:template count 1:)<< \
  (:template count %20:)[[{$$pl_id}>{$$PageCount}}]] \
  (:template count last:)>>
  [[#plseriesend]]
  
This could then be used to create a series of links,
say above and below a pagelist like this:

  (:pagelist pl_id=pl1 fmt=#plseries :)

  (:pagelist size=20 id=pl1:)

  (:pagelist pl_id=pl1 fmt=#plseries :)

As long as the pagelists return the same pages, this
should work.  An additional simplification would be to
use the saved pagelist paradigm that I think Christian
mentioned.  This way the three pagelists can easily be
kept in sync without having to worry about giving them
the same parameters, maybe like this (I don't remember
the exact proposed syntax):

  (:pagelist pl_id=pl1 fmt=#plseries save=pl1set:)

  (:pagelist size=20 id=pl1 include=pl1set:)

  (:pagelist pl_id=pl1 fmt=#plseries include=pl1set:)


Does that seem a little more versatile/user friendly
than explicit math (it also gives another good use
case for saved pagelist sets)?


-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