[pmwiki-users] pagelist pagination

Patrick R. Michaud pmichaud at pobox.com
Wed May 16 20:13:31 CDT 2007


On Wed, May 16, 2007 at 05:10:41PM -0700, Martin Fick wrote:
> What if the templating engine put a special markup
> around each iteration like this:
> 
> (:iteration:)
> ...
> (:iteration:)
> ...
> (:iterationend:)
> 
> This markup would basically mean: "if the section
> after this is not blank, increment internal counter
> and if the counter is not within the paging range,
> delete everything up until the next (:iteration:). 
> This would not require any thought on the user's part
> in the template, the pagelist count would just
> magically work! :)

Alas, I think this still has some holes in it.  Consider
a order-by-group template like:

    [[#mytemplate]]
    (:if ! equal {<$Group} {=$Group}:)

    {=$Group}:
    (:if auth edit {=$FullName):)
    * {=$FullName}
    [[#mytemplateend]]

If the visitor doesn't have edit permission to the
first page in any group, we still end up counting the
page (because the per-group header makes the interval
"non-blank").

The same is true even if we use (:template first {=$Group}:)
instead of (:if ! equal {<$Group} {=$Group} :) .

This makes me like the if= approach more and more, because it
doesn't suffer from these sorts of problems.

Still, this is an _excellent_ suggestion and gives me a new angle 
with which to think about the overall problem.

Thanks!

Pm



More information about the pmwiki-users mailing list