[pmwiki-users] How to make a Pagelist Template?

Patrick R. Michaud pmichaud at pobox.com
Thu Apr 12 11:04:07 CDT 2007


On Thu, Apr 12, 2007 at 10:20:03AM +0100, Hans wrote:
> Thursday, April 12, 2007, 8:51:00 AM, SMETS wrote:
> 
> > http://www.pmwiki.org/wiki/PmWiki/PageLists?from=Cookbook.PagelistExplained
> 
> It seems that there is no documentation about the (:template ..:)
> directive for pagelist templates. Is it somewhere hidden?

It just hasn't been written yet as documentation.  (Writing the
documentation for this is one of the many things on my "to do"
list.)

> I thought (:template..:) was created to make building of pagelist
> templates easier, if I remember rightly from previous user-list
> discussions.

That's correct.  Here's a brief synopsis, if anyone wants to work
on writing up more complete documentation for it:

    (:template defaults ... :)    
       default options for pagelists using this template

    (:template each:)
       markup for each page in the pagelist

    (:template first:)
       markup output only for the first page in the pagelist

    (:template last:)
       markup output only for the last page in the pagelist

    (:template first {=$Group}:)
       markup output only for a page where the value of {=$Group}
       has just changed

    (:template last {=$Group}:)
       markup output only for a page where the value of {=$Group}
       will change with the next page

So, we have:

    [[#template]]
    (:template defaults order=name:)
    (:template first:)
    Pages ordered by group
    (:template first {=$Group}:)
    
    Pages in group [[{=$Group}/]]
    (:template each:)
    * [[{=$FullName]]
    (:template last {=$Group}:)
       {=$Group} contains {$$GroupPageCount} pages.
    (:template last:)
       {$$PageCount} pages total.
    [[#templateend]]

Hope this helps,

Pm



More information about the pmwiki-users mailing list