On 25/05/2005, at 4:34 AM, Rowan Collins wrote:
No, I'm afraid not - parameters have to be explicitly referred to
within the template. There have been calls for optional parameters, or
even more complex "macro"-like structures, but there has been
resistance amongst the core developers to introducing too much
complexity and ending up with the template code acting as an
interpretter for a whole new language.
The best you can do in the meantime is pass the parameters empty, and
style your template so it doesn't look too ugly with them missing. In
the example you give, it would make sense to use un-named parameters
({{{1}}}, {{{2}}}, {{{3}}}, etc), so that you could call the template
as something like {{car colours|red|blue|green| | | | | | | | | | | }}
(where the template actually always displays 10 colours, but here
leaves the last 7 as " ")
This makes sense. The Macro or Dynamic templates may well be too
confusing for the average Wiki contributor given that they're quickly
approaching a basic programming language. Even standard templates are
confusing enough for many people. One thing on my long-term ToDo list
is to look at providing HTML forms for people to enter information in
to Wiki templates. This will provide another layer of abstraction
over the MediaWiki editing function. More technical contributors are
fine with this, but others do find the Wiki markup code complex.
I'll try that {{{1}}},{{{2}}},{{{3}}} example though, thanks.
--
rik