Page MenuHomePhabricator

Allow the first paragraph <p> to be moved above arbitrary leading templates on small screens
Closed, DuplicatePublicFeature

Description

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):

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.

Event Timeline

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.

+1 to this solution. To me it's an obvious and the only one.