[pmwiki-users] pmwiki-2.2.0-beta9 release (bugfix, pagevar filters in pagelists)

Pico pmwiki at ben-amotz.com
Tue Oct 3 07:20:39 CDT 2006


Pico wrote:
> Roman wrote:
> ...
>> It would be very helpful if pagelist
>> supported something like this:
>>
>> (:pagelist $:State=#CA#TX order=$:State:)
>>
>> I borrowed this syntax from (:include:) directive and it would have
>> basically similar meaning. It would start listing pages when $:State
>> matches 'CA' value and stop listing when $:State matches 'TX' value.
>> Some other modification as in (:include:) could work, too, e.g.
>>
> 
> Since that form (#string) refers to anchors, it seems pretty confusing 
> in this context as applied to the possible of a given page text variable 
> ($:State).  It would also be pretty limited, when what you are talking 
> about sounds like it would be better served with an explicit concept 
> like "between CA and TX, or more generally, concepts like greater than 
> and less than: CA>TX, or CA>=TX, which could also be extended to <=CA, 
> or >TX.
> 
> Pico
> 
> 
Of course, now that I think about it, PageListTemplates already use > = 
and < to test the iteration of regular page variables (Groups, but also 
FullName and others, I believe):

Use with page variables:
    =   current item
    <   previous item
    >   next item
Conditionals used to structure pagelist output:
    (:if equal {<$Group}:)               At beginning of list
    (:if equal {>$Group}:)               At end of list
    (:if ! equal {=$Group} {<$Group}:)   First item in group
    (:if ! equal {=$Group} {>$Group}:)   Last item in group

So that kind of testing would be the natural candidate, if supported for 
page text variables.


Pico
-- 

         __  /
        /   /
       /___/ _/  ___/  __  /
      /      /  /     /   /
    _/     _/  ____/ ____/

 >>>===pmwiki at ben-amotz.com===>




More information about the pmwiki-users mailing list