[pmwiki-users] Number of results of a pagelist query ?

Martin Fick mogulguy at yahoo.com
Fri Mar 2 00:21:30 CST 2007


--- "Patrick R. Michaud" <pmichaud at pobox.com> wrote:
> So, if we did this, then the pagecount template
> would simply be:
> 
>     [[#pagecount]]
>     (:template last:)
>     PageCount: {$$PageCount}
>     [[#pagecountend]]
> 
> Of course, someone might then say that they want to
> display only the "empty" section and skip any
> first/last component.  

As you point out this would not be so good since I
likely could want:

     [[#pagecount]]
     (:template last:)
     PageCount: {$$PageCount}
     (:template empty:)
     No Pages Returned
     [[#pagecountend]]


> string argument (e.g., 'page') to the first and
> last directives, as in:
> 
>     (:template first:)
>     Displayed at beginning of list (even if list
> empty)
>     (:template first page:)
>     Displayed only for first page in non-empty list.
>     (:template each:)
>     Displayed for every page in list.
>     (:template last page:)
>     Displayed only for last page in non-empty list.
>     (:template last:)
>     Displayed at end of list (even if list empty)
>     (:template empty:)
>     Displayed only if list is empty

This seems technically nice (featurefull), but I can't
say that it is intuitive.  In fact I really have to
think pretty hard to see it and I am still not quite
sure I see it.  What makes the blank first any
different than a constant first?  I guess if you just
define it as operating the way your example operates,
we will know, but it doesn't jump out at me...  I do
however see and like the power in it.

Another approach could be to allow multiple arguments
to the (:template:) directive:

     [[#pagecount]]
     (:template last,empty:)
     PageCount: {$$PageCount}
     [[#pagecountend]]

or

     [[#pagecount]]
     (:template last || empty:)
     PageCount: {$$PageCount}
     [[#pagecountend]]

or should it read:

     [[#pagecount]]
     (:template last AND empty:)
     PageCount: {$$PageCount}
     [[#pagecountend]]

Of course, how could you differentiate those when you
add a variable to the mix?

     (:template last {=$Group}, empty:)

Not very nice,

-Martin


 
____________________________________________________________________________________
Now that's room service!  Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.
http://farechase.yahoo.com/promo-generic-14795097



More information about the pmwiki-users mailing list