Ive readed http://meta.wikimedia.org/wiki/Help:Template_names%2C_variable_names_and_par... and http://meta.wikimedia.org/wiki/Help:Templates#Parameters , but I'm weak in english, and I dont fully understand this pages. I've looked on Polish wikipedia about examples but i didnt found anything interesting.
On my wiki (about football) i have thousends of matches, like that:
12.06.1993 Football Team 1 - Football Team 2 1:3 Scorers: Team 1 Scorer - Team 2 Scorer I (43min), Team 2 Scorer II (65,81 min) Team 1: Player 1, Player 2, Player 3, Player 4 ... Team 2: Player 5, Player 6, Player 7 (32 min Player 8), Player 9 ... [[12.06.1993 Football Team 1 - Football Team 2|Read more...]]
but writing it manualy is very long, about few days toi make only one season. It is possible to make this in template, and only give variables then calling it? It will be very hard becouse numbers of goal scorers and subsidions is different in different matches. Can someone give my example or explain to how do it?
Wiadomość wysłana przez program DRACO ORGANIZER http://www.dshome.pl
Quoting =?iso-8859-2?Q?Micha=B3 Gawro=F1ski?=, from the post of Mon, 23 May:
On my wiki (about football) i have thousends of matches, like that:
looks like a serious headache to keep it all on a wiki rather than generate this from a database. the plus side of a database application will be the ability to do all sorts of fun statistics too.
If you really have to have it on a wiki, you could always create text from the database and feed it to the wiki with a bot...
On 24/05/2005, at 6:34 PM, Ira Abramov wrote:
Quoting =?iso-8859-2?Q?Micha=B3 Gawro=F1ski?=, from the post of Mon, 23 May:
On my wiki (about football) i have thousends of matches, like that:
looks like a serious headache to keep it all on a wiki rather than generate this from a database. the plus side of a database application will be the ability to do all sorts of fun statistics too.
On a related point, does anyone have an example or reference for a template in which one or more fields may or may not require repetition when called? What I mean is, for example, if you wanted to describe the colour of each car in the queue at the traffic lights outside your house each morning at 08:00. Each day you would create a new page using the template. However, every day, the number of cars would vary between 0 and n. Is there a way of building this sort of variable in to a template so that it can be called with a different number of colours (in this example) for each car in the queue?
Before anyone gets worried, I'm not creating a car counting Wiki. It's just an example. -- rik
On 24/05/05, Rik Wade rik@rikwade.com wrote:
[...] However, every day, the number of cars would vary between 0 and n. Is there a way of building this sort of variable in to a template so that it can be called with a different number of colours (in this example) for each car in the queue?
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 " ")
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
mediawiki-l@lists.wikimedia.org