Feature summary (what you would like to be able to do):
On the mobile version of MediaWiki sites, infoboxes, thumbnail media, and figures placed at the top of pages appear after the first paragraph. This is to improve the reader experience by putting the most important information first. There should be a way to force this behavior with any template, not just the ones hardcoded into the system. For example, the https://en.wikipedia.org/wiki/Template:Listen listen template, which plays audio files, should appear after the first paragraph on mobile pages when placed at the top of a page, consistent with the behavior of thumbnail audio files. But it doesn't.
Steps to reproduce (a list of clear steps to create the situation that made you report this, including full links if applicable):
- Visit https://en.m.wikipedia.org/wiki/King_Cotton_(march). If you are on a desktop browser, narrow your window.
- Observe that the "Listen" template captioned "John Philip Sousa's "King Cotton", which was composed in 1895, being performed by the United States Marine Corps Band" occurs before the first paragraph, diminishing the reader's experience.
- Visit https://ja.m.wikipedia.org/wiki/%E3%82%B3%E3%83%AB%E3%83%BB%E3%83%8B%E3%83%89%E3%83%A9%E3%82%A4_(%E3%83%96%E3%83%AB%E3%83%83%E3%83%95). If you are on a desktop browser, narrow your window.
- Observe that the bare audio thumbnail at the top of the article correctly occurs after the first paragraph, inconsistent with the behavior of the listen template.
Use case(s) (describe the actual underlying problem which you want to solve, and not only a solution):
- Less common article-heading templates should often appear after the first paragraph, but they do not currently because they do not fit into one of the hardcoded categories of templates.
- The current workaround for this is using infoboxes for non-infobox purposes. This causes an issue because some users automatically hide infobox templates, but they might not intend to hide the infobox-in-name-only templates that are affected by this issue. I also think it is bad to tag something as an infobox when it is not an infobox.
- One possible solution would be adding a new recognized HTML class to mediawiki-extensions-MobileFrontend/includes/Transforms/MoveLeadParagraphTransform.php. Under this idea, adding this new class to a template would cause the first paragraph to be moved above it when it is placed at the top of a page.