User:Mathglot/sandbox/Test pages/Expand language display customization

Ideas and proof of concept for customizing the display of the Expand language template on article pages.

Background
The result of this Tfd about Template:Expand language was 'keep' i.e., don't move it to the talk page. But, it was clear from the comments that some users would prefer to have the template at the bottom of the page, while others were more or less okay with it at the top, but found it too obtrusive and would seek to minimize it somehow. Some preferred to do away with it entirely.

Intro
This is a proof-of-concept attempt, to see what, if anything can be done to satisfy these users, without changing the default or in any way undoing or modifying the 'status quo' result of the Tfd. Looking at the Tfd comments, we can extrapolate the the following possible objectives:
 * 1) make the template less obtrusive
 * 2) move the template to the bottom of the page
 * 3) do not display the template from the page

I found that through code changes and appropriate use of common.css, it's possible to achieve any of these goals by opt-in features not affecting anyone else:
 * Reduce the box height, to make it less obtrusive, by:
 * changing font size and image size slightly.
 * making the box wider, so text doesn't wrap to a second line in some cases
 * dropping text (notably: 'click show to view important translation instructions')
 * Move the box to the bottom of the page.
 * Make the box disappear.

Approaches
The approach I'm looking into involves some transparent code changes and some css:
 * modify the code to add additional css classes as needed to implement the goals above
 * define some css style that can be used in common.css in order to opt in to various customizations, as desired

Another approach, might have been to include the style directly in the template itself, under control of some new parameter. This might be possible, but it doesn't seem in keeping with how other templates are created and used, and since common.css (and common.js) are provided by default to users and can be, and are used for all sorts of style customizations, this seemed like the right place to try to achieve the goals.

Proof of concept implementation
Implementation involve a two-prong approach:
 * initial proof of concept – using one or two daughter templates, so that, say, "Expand French" can be customized
 * expansion to include direct use of Expand language in articles, in a customizable fashion.

This can be done by introducing new css classes to the &lt;table> element generated by Ambox. For objectives 1 (less obtrusive) and 3 (remove), only one class is needed, but for objective 2 (move to bottom) two classes are needed. This is because of the difference between top-of-page, article-level Expand &lt;language> templates, of which there can be only one by definition and section-level templates, of which there can be many. Only one template can be placed at the bottom of the page, because absolute positioning is used for this, so section templates should not be moved, only the article template should be, if the user opts in for that.

Use of absolute positioning
Use of absolute positioning is part of the proof of concept, just to see if opt-in move is possible, but it isn't a permanent solution. If other templates tried to implement the same thing, they could interfere with each other, each one trying to "claim" the bottom spot. If the initial concept works, then a more permanent solution would require use of common.js to insert the html of the box near the #footer, maintaining relative positioning, rather than just overlay it on top of whatever was already there with absolute positioning. This would allow moving any number of templates, which would stack up at the bottom without impacting each other.

On the other hand, if "moving to the bottom" was only a compromise offer by those who would rather see the box eliminated entirely, and there aren't many who actually want to see it at the bottom of the page, then this whole problem just goes away. The point of absolute positioning in the initial approach was just to see if it could be done at all, and it can be.

Box classes
Template Expand French (like all other "Expand" templates) currently generates these classes in the &lt;table> element:
 * box-Expand_language
 * plainlinks
 * metadata
 * ambox
 * ambox-notice

We

Testing
Choosing French as the initial language, here are some articles that use Expand French:
 * André Diethelm
 * Institute for Research on the Jewish Question
 * Ordinance of 9 August 1944
 * Provisional Consultative Assembly
 * Ward of the Nation