On 05/22/2012 09:39 PM, Daniel Kinzler wrote:
the {{#data-value}} function lets you output all
of these "parts" all at
once (or separately, if you like), and lets you control aspects like the format
of the output using parameters. If you choose to output multiple parts at once,
{{#data-value}} can use its knowledge about the desired HTML form to do this
nicely. E.g.
<span>{{#data-value:data.population|show=label,value,timestamp,source,indicators,edit|form=tr}}</span>
would be rendered as
<tr>
<td>Population</td>
<td>523,411</td>
<td>2010</td>
<td><a href="#src23">[1]</a>,<a
href="#src23">[2]</a></td>
<td><a title="disputed" href="..."><img
src="..."/></a></td>
<td>[<a title="edit"
href="...">edit</a>]</td>
</tr>
Its hard to imagine how to achieve this nicely without using parser
functions. -- Duesentrieb (talk) 19:37, 22 May 2012 (UTC)
An alternative might be to return JSON from the parser function and let
a Lua module, some other parser function or even a new templating
construct handle the formatting.
Gabriel