See http://en.wikipedia.org/wiki/Wikipedia:Requests_for_arbitration#.5B.5BWikipe...
A question: is there any good reason to keep templates in templates working on the Wikimedia servers?
- d.
David Gerard wrote:
See http://en.wikipedia.org/wiki/Wikipedia:Requests_for_arbitration#.5B.5BWikipe...
A question: is there any good reason to keep templates in templates working on the Wikimedia servers?
They're pretty useful in some cases to simplify the markup a user has to edit. For example, the British election results used a template where you put the name of the party as one parameter, and based on that it then included a meta-template with the appropriate formatting (displayed name that fits in the width, article to link the name to, and color to use for highlighting the cell).
This could be replaced by scriptable templates, but that may be a bigger problem. Basically, subtemplates in a lot of places are used as a simulation of "if" statements, and in a lot of places, "if" statements are exactly the natural thing to do. An alternative is to duplicate the templates for every possible outcome of the 'if", like {{templatewithparam1}} {{templatewithparam2}}, etc., which are identical except for the one part that should be different, but that's much less convenient from a user's point of view.
-Mark
David Gerard fun@thingy.apana.org.au wrote:
http://en.wikipedia.org/wiki/Wikipedia:Requests_for_arbitration#.5B.5BWikipe...
If I understand correctly (and I may not understand correctly, so please correct me if I'm wrong), the basic argument is that when you edit a meta-template you invalidate a lot of pages, which then have to be rebuilt. But meta-templates are most often used when many templates should have the same formatting, correct? So wouldn't you just have to edit all of the templates individually, invalidating the same number of pages?
To put it more concretely:
Pages A-M use template 1. Pages N-Z use template 2. Let's say that templates 1 and 2 are similar, so if we allow meta-templates they're based on template 0.
Editing template 0 will invalidate both A-M and N-Z. But presumably if we had to edit template 0, we would otherwise have to edit both templates 1 and 2 anyway, which *also* means that A-M and N-Z are both invalidated. It could even save us cache misses if both 1 and 2 are used on the same page.
So I don't see how avoiding meta-templates will help anything.
wikitech-l@lists.wikimedia.org