[pmwiki-users] pagelist pagination

noskule noskule at gmx.net
Wed May 16 12:43:10 CDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Patrick R. Michaud schrieb:
> On Wed, May 16, 2007 at 05:55:20PM +0200, noskule wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Patrick R. Michaud schrieb:
>>> I'm not sure what my plans for this will be.  It is a tricky problem,
>>> because if a pagelist template uses any (:if:) directives to exclude
>>> pages from appearing in a list, then we can't be certain of the
>>> count of pages being displayed.  
>>>
>>> For example, people will get very confused if they specify count=1..10,
>>> but an (:if:) directive in the pagelist template only displays 5 of them.
>> a new argument called break, part, split or the like could be used
>>
>> (:pagelist count=50 break=10:)
>>
>> would mean take 50 units and display it in junks of then units.
> 
> This doesn't really solve the problem, in that it's not 
> currently possible for (:pagelist:) to know exactly how many 
> "units" are actually displayed by the pagelist template.
> 
> For example, consider the following pagelist, which displays
> only those pages for which the visitor has edit permission:
> 
>     (:pagelist fmt=#mytemplate count=10:)
> 
>     [[#mytemplate]]
>     (:if auth edit {=$FullName}:)
>     * {=$FullName}
>     [[#mytemplateend]]
> 
> Suppose the site contains exactly ten pages that the visitor
> can edit.  Will the visitor see all ten in this pagelist?
> 
> The answer is "no", because pagelist first generates a list
> of pages, uses count= to cut the list to the first ten, and
> then displays those ten pages using the pagelist template.
> But the template will not display any of the pages that
> the visitor cannot edit, thus the number of pages that
> gets displayed could be much fewer than ten -- even zero!
> 
> So, because it's possible to use (:if:) directives to
> suppress the display of certain pages in the list, we don't
> know exactly how many pages are displayed, nor are we certain
> of the exact "count" to use for the next block of pages.
> 
> If we ignore the possibility of some pages not being
> displayed by (:if:), the problem does become much simpler.
> 
> Pm
> 
and if there would be a slolution to manipulate the counter like
    if ! auth edit {=$Fullname} count=count-1
    else "that what you would do if you had edit access"

or a condition for doing the iteration or jump to the next

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGS0KtrGF5npnsxVgRAluoAKDQFiWzQI2kYVTJqx7PclQTBLuPUgCggXbx
KNme+yLPsC2ap1/tU4/WndU=
=d92O
-----END PGP SIGNATURE-----



More information about the pmwiki-users mailing list