[pmwiki-users] making pagelist template produce a cell, not a table

Jean-Fabrice [gmail] jeanfabrice at gmail.com
Fri Jan 19 06:12:14 CST 2007


2007/1/19, The Editor <editor at fast.st>:
>
> You could try putting the table and tableend in the template, like this:
>
> [[#zapdocs]]
> (:if equal {<$Group}:)(:table:)
> (:cellnr bgcolor=#e4e4e4 colspan=2:)'''{$$heading}'''
> (:if:)
> (:cellnr bgcolor=#f7f7f7:)[[{=$FullName}|{=$:docid}]]
> (:cell bgcolor=#f7f7f7:){=$:doclabel}
> (:if equal {>$Group}:)(:tableend:)
> [[#zapdocsend]]
>
> Note I use it with a pagelist like this: (:pagelist fm#zapdocs
> heading='My stuff':) so I can have different headings on different
> tables and still just have one template.
>
> Cheers,
> Dan
>

My example was not really accurate, let me apologize.

Here is exactly what I want to do :
(:table:)
(:cellnr:)head1
(:cell:)head2
(:cell:)head3
(cellnr:)data from aGroup
(:pagelist Group=aGroup fmt=#myFmt trapvalue:)
(:cellnr:)data from anotherGroup
(:pagelist Group=anotherGroup fmt=#myFmt trapvalue:)
(:cellnr:)data from athirdGroup
(:pagelist Group=athirdGroup fmt=#myFmt trapvalue:)
(:tableend:)

and define #myFmt to be :
(:cell:)pagetextvar1
(:cell:)pagetextvar2
(:cell:)pagetextvar3

i.e :
Each searched group contains only one page with 'trapvalue' in it
Each of this page have the same form (i.e the same pagetextvar)

The goal is to display a table having one row per group, where the
first cell is the name of the group or whatever text in relation with
this group and the others cell are pagetextvar extract from the return
page for this group.

JF




More information about the pmwiki-users mailing list