[pmwiki-users] Pagelist conditionals

Patrick R. Michaud pmichaud at pobox.com
Mon Feb 19 10:01:36 CST 2007


On Mon, Feb 19, 2007 at 10:36:23AM -0500, Crisses wrote:
>    I'm working on a blog listing, and I'd like to include the first ten
>    posts, then under it have "Older News..." and have it continue to list the
>    rest of the blog postings under it.  I'm using "blog with pagelist" which
>    works OK except when I want listings 11+ different than 1-10.
>    In the pagelist template, I can explicitly match {$$PageCount} 1-10 with a
>    conditional, but I can't really do 11-infinity.  I guess I could do 11-20
>    then put a "list all" link to a search criteria....
>    Is there a way to do greater than or less than for conditionals?  

The ConditionalExtensions recipe provides some 
relational operators that might work -- see
http://www.pmwiki.org/wiki/Cookbook/ConditionalExtensions .

However, I'm also wondering if we should make the count= parameter in
(:pagelist:) use a syntax similar to the lines= parameter in
(:include:).  In other words:

    (:pagelist count=10 :)       # first ten pages
    (:pagelist count=1..10 :)    # first ten pages
    (:pagelist count=11..20 :)   # second ten pages
    (:pagelist count=11.. :)     # skip first ten pages

Previous proposals had looked at providing a "skip=" or "first="
parameter to pagelist, but this seems a bit more consistent.

e may still provide a skip= or first= parameter that can be
combined with count.  However, much of what skip= or first= would
do could be handled within the pagelist template itself, if 
some form of relational ops are available.

I'm still not certain of how to do paged output when the
pagelist template itself does some form of selecting records
to display.  Perhaps an (:if count:) directive or a {$Counter}
page variable that keeps track of the number of times it has been
evaluated in the context of a particular set of markup.  Or
perhaps a directive that increments a named counter of some sort.

Pm



More information about the pmwiki-users mailing list