[pmwiki-users] pagelist template brainstorming

christian.ridderstrom at gmail.com christian.ridderstrom at gmail.com
Tue Feb 20 06:41:29 CST 2007


On Mon, 19 Feb 2007, Patrick R. Michaud wrote:

> On Mon, Feb 19, 2007 at 06:08:21PM -0000, marc wrote:
>> Patrick R. Michaud said...
>>> Another possibility for first/each/last:
>>>
>>>     (:firstpage:)   (:eachpage:)   (:lastpage:)
>>>     (:firstpage {=$Group}:)   (:lastpage {=$Group}:)
>>
>> I like this best. Thus, (:nopages:), I presume.
>>
>> Ain't evolution a fabulous thing!
>
> Since there seems to be a wide range of opinion over a
> fast moving target, I've started a page at
> http://www.pmwiki.org/wiki/Test/VoteOnFirstLastMarkup
> where people can register their opinions (votes) on
> each of the options we've identified thus far.
>
> Just add your name and +1/-1 by each alternative you like and dislike. 
> E.g., I would use "Pm +1" to vote in favor of a syntax I like and "Pm 
> -1" to vote against a syntax I don't like.

I added another alternative where a single directive is used to delimit 
parts of the template, and the first argument controls the part. Below is 
what it'll look like if 'template' is used as the name of the directive.

    (:template first:)            - first page in the list
    (:template last:)             - last page of the list
    (:template each:)             - each page of the list
    (:template first {=$Group}:)  - first page in a group
    (:template last {=$Group:)    - last page in a group
    (:template nopages:)          - markup if the pagelist is empty
    (:template defaults:)         - default pagelist options for the

As an aside, we might wish to introduce synonyms for things like

 	(:template foreword:)
 	This stuff goes before the pagelist even starts.

 	(:template afterword:)
 	This stuff goes after everything.

One advantage I see with using a single directive for definining the parts 
of a template is that we actually are free to add additional first 
arguments to this directive later on without worrying about collisions 
with other directives. This is not the case if we use separate directives 
based on words such as 'first', 'last', 'each', 'nopages' or 'defaults'.

/Christian

-- 
Christian Ridderström, +46-8-768 39 44               http://www.md.kth.se/~chr


More information about the pmwiki-users mailing list