In thinking about improving page issues for mobile, we would like to know which/how many ambox templates contain text marked as "hide when compact", which means they contain text that can be hidden on mobile. Ambox templates that contain this text would take up less space on small screens, and therefore would be easier to display on mobile.
Question we are trying to answer
- How many ambox templates would be suitable to display on mobile with just css changes?
- How does this vary by language?
Analysis
tldr;
👍 I think we're in pretty good shape.
Method
I've taken an extensive inventory of "page issue" templates across a variety of languages using the mediaWiki API and this script. The script essentially parses templates that belong to a specific category. On English Wikipedia for example, it parses all the templates that are members of the category Category:Article message templates. The templates are then rendered in an HTML table with CSS added to see which can be made compact or not. A sum of the compact templates is also generated.
Disclaimer
This method works for languages that actually have a category for all "page issues". Not all languages do, some only have more specific categories. Also, only the top-ten wikis were used in this report.
Findings
- On English Wikipedia - 364 out of 377 templates had hidable elements. (92%)
- hiding with a .hide-when-compact selector.
- From category: https://en.wikipedia.org/wiki/Category:Article_message_templates
- On Chinese Wikipedia - 115 out of 124 templates had hidable elements. (93%)
- hiding with a .hide-when-compact selector.
- From category: https://zh.wikipedia.org/wiki/Category:條目訊息模板
- On Russian Wikipedia - 157 out of 207 templates had hidable elements. (76%)
- hiding with a .mbox-textsmall-div selector.
- From category: https://ru.wikipedia.org/wiki/Категория:Шаблоны:Предупреждения
- On French Wikipedia - 78 out of 113 templates had hidable elements. (69%)
- hiding with a .bandeau-titre ~ p selector.
- From category: https://fr.wikipedia.org/wiki/Catégorie:Modèle_de_bandeau_d%27article
- On Japanese Wikipedia - 4 out of 19 templates had hidable elements. (21%)
- hiding with a .hide-when-compact selector.
- From category https://ja.wikipedia.org/wiki/Category:記事メッセージボックス
- a larger sample size should be investigated.
There were no hidable selectors found for templates from
- Spanish - https://es.wikipedia.org/wiki/Categor%C3%ADa:Wikipedia:Plantillas_de_contenido
- Italian - https://it.wikipedia.org/wiki/Categoria:Template_di_avviso
- Polish - https://people.wikimedia.org/~jdrewniak/page_issues_inventory/pl.index.html
- Portuguese - https://people.wikimedia.org/~jdrewniak/page_issues_inventory/pt.index.html
- German - https://de.wikipedia.org/wiki/Kategorie:Vorlage:Wartungsbaustein
Wikipedias.
Conclusion
Half of the top-ten Wikipedia had hidable elements, and the other half didn't. On the wikis that did have hidable elements, they were hidable for a majority of the templates.
Sources
This script which generated these tables.
Sign-off criteria
- Make wiki page for page issues and put all this there. (https://www.mediawiki.org/wiki/Reading/Web/Projects/Mobile_Page_Issues#Inventory_of_mobile-friendly_page_issues)