Nicolas Weeger wrote:
I was wondering whether it would be possible or not to
have extended
{{msg:}} syntax which could include parameters.
Yes, of course this would be possible. And of course people have already
had this idea. It's just that nobody has gotten around to actually
coding it yet.
I imagine this would require some detailed specification and planning
before implementation, or else we run into flexibility problems later.
For instance, an obvious solution would be to have $1, $2, etc. in the
template. However, once you think about it, you realise that this is
stupid because
(a) you can only have ten parameters, unless you come up with some
complicated syntax to specify whether $10 is supposed to mean
[$1] + 0 or [$10];
(b) you can't easily obsolete a parameter you no longer need, because
it would shift all the other parameters to other names;
(c) it simply doesn't tell you what they mean
(d) various other reasons
I suppose a much better idea would be key-value pairs, e.g.
{{msg:Template|name=Robert E. Lee|born=19.01.1807|died=12.10.1870}}
and then using {$name}, {$born}, {$died} in the MediaWiki text.
This is still rather unflexible because it doesn't allow for
(a) default values if a parameter isn't specified
(b) conditional inclusion of stuff (e.g. a table row)
(c) lists/arrays
It is difficult to come up with a use for the latter, but the former two
are very important.
It only gets more and more complicated. :)
Timwi