[pmwiki-users] pagelist template brainstorming

Patrick R. Michaud pmichaud at pobox.com
Sun Feb 18 08:41:32 CST 2007


On Sun, Feb 18, 2007 at 11:08:01AM +0100, Petko Yotov wrote:
> On Sunday 18 February 2007 06:46, Patrick R. Michaud wrote:
> > So, again my questions are:  Would markups such as these make it
> > easier or more difficult for people creating pagelist templates?  
> > And is the (:first:)/(:each:)/(:last:) syntax appropriate, or
> > would a different syntax be more desirable?
> 
> Why not use just "each..eachend"? This way there is no need for 
> first and last markups: what is before the first "each" and 
> after the "eachend" in the template will be included if 
> there are pages. 

I think that "first" and "last" read more naturally (author friendly).
In normal speaking we say things like "First do ..., then for each 
item do ..., and lastly do ...".  Also see my previous message to
Kathryn Andersen about the case where the order of 
(:first:)/(:each:)/(:last:) isn't fixed.

> Also, the "each group" thing can be greatly simplified if it is just 
>   (:each group:)

Yes, but we may want to control break on things other than groups...
    
    (:each {=$LastModifiedDay}:)       # by day
    (:each {=$:Status}:)               # by status page text var
    (:each {=$Title1}:)                # by first letter of title

> Additionally, in the template there may be a section
>   
>   (:notfound:)
>   Sorry, no pages found for your query.

We could do this within the proposed syntax with:

    (:first:)
    (:if equal {>$Group}:)
    Sorry, no pages found for your query.

or even

    (:last:)
    (:if equal {$$PageCount} 0:)
    Sorry, no pages found for your query.

I can see value in having a (:notfound:) shortcut for this...
but somehow I prefer to avoid adding too many special-purpose
directives here (in spite of the fact that I've just proposed four
new ones :-).

Thanks!

Pm



More information about the pmwiki-users mailing list