[pmwiki-users] pagelist pagination

Hans design5 at softflow.co.uk
Wed May 16 10:15:13 CDT 2007


Wednesday, May 16, 2007, 3:23:52 PM, Patrick R. Michaud wrote:

>> Could you please give us some info about your plans for this and your
>> recommendations ?

> 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.

I have now a working draft of a breakpagelist recipe.
The problem I encountered about getting an accurate pagelist count
(see on pmwiki-devel 13.May Pagelist count problem) I did not get
solved, but found a not-so-nice way around, by using a second pagelist
with a customised count fmt, which sets a global $BPLCount variable.
This is then used in a function which is called by a (:breakpagelist:)
markup and by the two page variables {$BPLFrom} and {$BPLTo} which
determine the section of pagelist to be displayed via
count={$BPLFrom}..{$BPLTo}

It works, but there is probably  a lot of overhead, and the
requirement to have the second pagelist markup just to get the count
global. So it makes for ugly and possibly confusing markup, like this
example with  a trail=Site.AllRecentChanges pagelist:

(:pagelist trail=Site.AllRecentChanges  list=normal fmt=maxcount :)

(:breakpagelist:)

(:pagelist trail=Site.AllRecentChanges list=normal fmt=#recentchanges
   count={$BPLFrom}..{$BPLTo} :)

If the first pagelist could be eliminated it could make a possible
recipe, but with it I think better not.

Maybe scripts/pagelist.php can be tweaked to always set
$MatchCount as a  global?


  ~Hans




More information about the pmwiki-users mailing list