[pmwiki-users] pagelist template brainstorming

Hladůvka Jiří mail at revida.sk
Sun Feb 18 09:31:21 CST 2007


I do not understand the meaning of

"before the first record", "after the first
record", "before the last record", and "after the last record",

Does it mean "after the first record" was displayed ? What is it good for?
Usually we need to say:
   Here is the start of the report
   Hee is the start of {=$:State} grouped records
   Here starts the {=$:City} in {=$:State} grouped records
   first record of group {=$:City} in {=$:State}
   ....
   last record of group {=$:City} in {=$:State}
   Here is the end of {$justprocessedCity} in {$justprocessedState}  xxx 
records displayed
   Here is the end of {$justprocessedState}  yyy records displayed
   Here is the end of the report

The occurence of the first and last record from point of view of the 
printout
does no matter. It must be treated in the script source to trigger key 
values change (group start, group end)
but from the point of view *what* and *how* is the report presented they 
are equivalent.
(:each {=$:State} {=$:City}:) is not necessary if "each" means really 
each record that passed the filter.

On the other hand 
(:first {=$:State} {=$:City}:) and
(:last {=$:State} {=$:City}:)
are very important if we have more grouping levels

If we invent some users_pagelist_variables so we can
to clear them in the "first" blocks, to modify them in subsequent "each" 
and to print them (or sumarize to higher group level) in the "last" blocks.
But this is somethig more than pagelist  only :-)

Jiri


Patrick R. Michaud napsal(a):
> On Sun, Feb 18, 2007 at 06:21:45PM +1100, Kathryn Andersen wrote:
>   
>> On Sat, Feb 17, 2007 at 11:46:26PM -0600, Patrick R. Michaud wrote:
>>     
>>> But somehow I think it reads better if (:each:) simply watches
>>> a value for control breaks, and that we tell authors to always
>>> use (:if:) when a condtional needs to be evaluated.
>>>       
>> I agree; since "each" is related to "each page" or "each value",
>> I think it's cleaner not to make it use a conditional expression.
>>
>> Would there arise a situation where one would wish to check more than
>> one value, though?
>>     
>
> Sure, one could do this with something like:
>
>     (:each {=$:State} {=$:City}:)
>
> to get a control break anytime the state or city changed.
>
>   
>>> And is the (:first:)/(:each:)/(:last:) syntax appropriate, or 
>>> would a different syntax be more desirable?
>>>       
>> Hmmm.  If (:first:) is *before* the first page, and (:last:) is *after*
>> the last page, do you think something like "start" and "end" or "pre"
>> and "post" might be better?  Or "plpre" etc?
>>     
>
> Well, as I think about it more, I think I overstated things in my
> original message.  (:first:) would specify markup only for the
> first page, and (:last:) would specify markup only for the last
> page, but the order would be specified within the pagelist template
> itself.  In other words, if an author wrote:
>
>     [[#template]]
>     (:last:)
>     ...and the last page is: 
>     (:each:)
>     {=$FullName}
>     [[#templateend]]
>
> then the text "...and the last page is:" would appear just before
> the last page in the list.  An author could even specify multiple
> first or last sections in the template -- all processed in the
> order they appear in the template:
>
>     [[#template]]
>     (:last:)
>     ... and the last page is
>     (:each:)
>     {=$FullName}
>     (:last:)
>     and we're done.
>     [[#template]]
>
> Granted, this is a bit of advanced usage, but it does give us an
> easy way to specify "before the first record", "after the first
> record", "before the last record", and "after the last record",
> with a syntax that does the natural thing if someone simply
> writes the natural sequence (:first:)...(:each:)...(:last:).
>   
The other issue I have with start/end or pre/post is that I think
> first/last may be more author (non-programmer) friendly.  It also
> helps us to think of things in terms of lists of pages, which
> is what this is all about.
>
> Excellent comments!
>
> Pm
>
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
>
> __________ Informacia od NOD32 2068 (20070218) __________
>
> Tato sprava bola preverena antivirusovym systemom NOD32.
> http://www.eset.sk
>
>
>
>   




More information about the pmwiki-users mailing list