On 23.05.2012 12:53, Gabriel Wicke wrote:
On 05/22/2012 11:52 PM, Daniel Kinzler wrote:
On 22.05.2012 22:37, Gabriel Wicke wrote:
{{{data.color}}} would be inaccessible to Lua
templates, unless it is
expanded as a parameter in a custom preprocessor frame and then passed
by value to the Lua template. The custom preprocessor frame code would
be specific to the current PHP preprocessor, and incompatible with other
parsers.
A parser function call with explicit item parameter on the other hand
would work as-is through the generic API- be it from Lua or Parsoid.
even though {{{data}}} wouldn't be text, but a complex data object that needs
special handling when evaluating it to wikitext?
{{{data}}} won't be accessible to Lua or Parsoid.
{{#data:q12345|somevalue}} on the other hand would be accessible through
the regular parser function API.
So, you prefer a solution where the item to use is specified by id whenever a
property of that item is to be accessed? In that case, I'd indeed prefer
{{#property:population|item=id/q12345}}
or just
{{#property:population}}
when using the page's "own" item.
But if the id comes from a template parameter, things get annoying:
{{#property:population|item={{{item-id|*}}}}}
(where "*" would mean "use the page's default item)
This is very ugly, especially if you have to do it 20 or 50 times (for every
property).
A possible solution would be to assign local names to items:
{{#item:thingy|item=id/{{{item-id|*}}}}
{{#property:population|item=thingy}}
What do you think?
--
Daniel Kinzler, Softwarearchitekt
Wikimedia Deutschland e.V. | Eisenacher Straße 2 | 10777 Berlin
http://wikimedia.de | Tel. (030) 219 158 260
Wikimedia Deutschland - Gesellschaft zur Förderung Freien Wissens e.V.
Eingetragen im Vereinsregister des Amtsgerichts Berlin-Charlottenburg
unter der Nummer 23855 B. Als gemeinnützig anerkannt durch das Finanzamt
für Körperschaften I Berlin, Steuernummer 27/681/51985.