[pmwiki-users] (:cell:) in pagelist template?
Patrick R. Michaud
pmichaud at pobox.com
Tue Mar 27 11:21:36 CDT 2007
On Tue, Mar 27, 2007 at 07:22:02AM +0100, SteP wrote:
> (version 2.20beta38) I want to add a table column only when (:pagelist:)
> outputs something. I thought I could use the following format
> [[#f]]
> (:template first:)
> (:cell:)
> (:template each:)
> test
> [[#fend]]
>
> and page text
>
> (:table class"test" border=1:)
> (:pagelist fmt=#f count=1:)
> (:pagelist fmt=#f count=1:)
> (:tableend:)
>
> however this results in two separate, stacked tables instead of the two
> side-by-side columns I was expecting. It looks like the (:table:) markup
> line is ignored, so each (:cell:) automagically becomes a whole table.
No, what is really happening is that any open tables, divs, or other
structures inside of (:pagelist:) are automatically closed at the
end of the pagelist command. In other words, (:pagelist:) acts like
its own complete page, as opposed to generating markup that is then
inserted into the enclosing page.
So, what is happening is that the table generated by the (:cell:)
directive in the first (:pagelist:) command is automatically closed
at the end of the pagelist. The (:cell:) in the second (:pagelist:)
command then starts a new table.
Note that the (:table:) directive doesn't actually start a new table,
it's the (:cell:) or (:cellnr:) directive that does it. All that the
(:table:) directive does is set attributes for any tables that follow.
> How can I achieve adding a table column only when pagelist outputs
> something?
I can't think of a way to do this, as yet. But see my message at [1],
which proposes the addition of an outputtype=markup option which would
allow (:pagelist:) to return the markup to the enclosing page, as
opposed to rendering it standalone.
[1] http://www.pmichaud.com/pipermail/pmwiki-users/2007-March/041000.html
Pm
More information about the pmwiki-users
mailing list