[pmwiki-users] site index
Roman
romat2 at gmail.com
Fri Oct 26 05:15:06 CDT 2007
> You could do some kind of column spliting by adding a modulo function
> to MarkupExpr. In your config.php, just add:
>
> $MarkupExpr['mod'] = '($args[0] % $args[1])';
>
> Then, define a pagelist template such as:
>
> [[#threecols]]
> (:template first:)
> (:table:)
> (:template each:)
> (:if equal 1 {(mod {$$PageCount} 3)}:)
> (:cellnr:)[[{=$FullName}]]
> (:else:)
> (:cell:)[[{=$FullName}]]
> (:if:)
> (:template last:)
> (:tableend:)
> [[#threecolsend]]
>
> That you may use this like below:
>
> (:pagelist group=PmWiki fmt=#threecols:)
>
> For the record, the 'mod' function is now already available in latest
> MarkupExprPlus recipe.
> --
> Dominique
Good idea, but for my taste too many table cells. It would be fine if
PmWiki could have something like {$$TotalPageCount} in pagelists,
probably defined in (:template first:) section. Then we could define
pagelist template this way (with only 3 cells):
[[#threecols]]
(:template first:)
(:gettotalpagecount:)
(:table:)
(:cellnr:)
(:template each:)
(:if equal 1 {(ColumnBreak {$$PageCount} {$$TotalPageCount} 3)} :)
(:cell:)[[{=$FullName}]]
(:else:)
[[{=$FullName}]]
(:if:)
(:template last:)
(:tableend:)
[[#threecolsend]]
where ColumnBreak is defined as
$MarkupExpr['ColumnBreak'] = '($args[0] % ($args[1] / $args[2]))';
Roman
More information about the pmwiki-users
mailing list