In most cases on wikipedias of different languages, the documentation tells you to edit and format the code of infoboxes in this way:
{{Template
| name =
| short =
| longest parameter =
| another =
}}Somewhere it's just mentioned in the guideline text as a matter of course, like on the English wiki (1, 2), and somewhere, like on the Russian wiki it's explicitly stated as a guideline in the rules or by the consensus: here or here.
To design infoboxes this way, you have to manually count the number of characters of the longest parameter each time. And insert a custom formula like this
{{_↵| ________ = _↵}}↵
(where "_" is multiplied by number of symbols in the longest parameter). I can safely say that this is the basic template design practice of the biggest interlanguage wikipedias.
At the same time, this practice does not handle cases when long parameters are not used in a particular use of the template, but the visual editor changes the layout as if the parameter is used. Then the formatting of the template is made like this:
{{Template
| name =
| short =
| another =
}}This creates unnecessary spaces and code stretching. In some cases, a large number of spaces looks particularly unnatural and odd, and in a long list it can be difficult to quickly associate a parameter with a value without drawing dotted lines in the mind. This contradicts what such formatting was created for - to make the code easier to read.
In some cases, because of this, when writing a formula in TemplateData, you have to ignore the longest parameters that are rarely used (e.g. in 5% of uses) so that the infobox won't be stretched out in most articles (in 95% of uses). Then a fully filled infobox looks like this:
{{Template
| name =
| short =
| longest parameter =
| the longest parameter in the infobox =
| the second longest parameter in the infobox =
| another =
}}And this is already against the template formatting guidelines.
This situation is handled by gadgets aimed at standardising formatting in a particular article. The gadget truncates spaces, based on a long parameter in each case. On Russian wikipedia it's this one gadget, but I don't know of any such gadgets on English wikipedia (and I wish I did).
That's why I think it would be useful to have additional code formatting buttons in TemplateData, which would auto-regulate formatting alignment by the longest template parameter in a particular article. So that in one article, the visual editor would save the template like this:
{{Template
| name =
| short =
| longest parameter =
| another =
}}And in the other one like this:
{{Template
| name =
| short =
| another =
}}So I propose to deal with this situation by adding two separate new formatting options:
1. Fixed space alignment
In this case TemplateData will automatically find the longest parameter, and any editing of the template through the visual editor will save the code with fixed number of symbols between | and =, regardless of whether there is a long parameter in the article or not. This will help to avoid switching from fewer to more spaces when some wikis treat changeable spaces negatively. This is actually an automation of the practice that we do every time manually through custom formatting, but now always with a fixed length. That is, this option will always save the template this way:
{{Template
| name =
| short =
| another =
}}
{{Template
| name =
| short =
| longest parameter =
| another =
}}
{{Template
| name =
| short =
| longest parameter =
| the longest parameter =
| another =
}}and the second option is
2. Dynamic space alignment
This is more flexible formatting, where the visual editor will adjust the number of spaces for each particular article based on which parameter is the longest in every use. This is the most optimal formatting option, which would be both the most readable and respect the guidelines of wikipedia in each case. But I guess it will be a bit more difficult to implement. It should work this way:
{{Template
| name =
| short =
| longest parameter =
| another =
}}
{{Template
| name =
| short =
| another =
}}
{{Template
| name =
| short =
| longest parameter =
| the longest parameter in the infobox =
| another =
}}It seems to me that such a change would be extremely useful, as this is literally the dominant formatting in a most of the biggest wikipedias, that is also most often prescribed in the rules. And the fact that the visual editor has no way of automating this, requiring you to do character counts in every template, and then stretching spaces where it could have been avoided is a huge omission. Adding new styles would add significantly to the convenience and automation of working with the visual editor and TemplateData, and in many cases would fix the non-uniformity of formatting, where in one case it would be more useful to have option 1 = automate the current practice, and in another use option 2 = which is impossible with the current version of visual editor. Such a change would make the use of the visual editor much more tolerant to wikipedia norms.
