Most projects hide the heading on the main page by default. This is done, by blanking the associated message, however, this often results in an empty h1 being output to the page.
In Minerva projects see a user specific message "Welcome, USERNAME!" at the top of the page.
This issue is now showing up as part of Desktop Improvements (Vector 2022) where some editors would like to show the heading on the main page, with text other than the page name,
QA steps
No need to test in production.
- As an anonymous user visit https://en.wikipedia.beta.wmflabs.org/wiki/Main_Page?safemode=1 and check the heading says "Welcome to the Beta cluster!" Confirm this text is not in the browser tab/window title (<title>)
- As a logged in user visit https://en.wikipedia.beta.wmflabs.org/wiki/Main_Page?safemode=1 and check the heading includes your username. Confirm this text is not in the browser tab/window title (<title>)
Acceptance criteria
- On a default MediaWiki instance the heading is present on the main page for Vector
- On a default MediaWiki instance the heading is not present on the main page for Minerva (this will be changed in T293470)
- An editor can change the main page title to "Welcome to {{PROJECTNAME}}!"
- The title for logged in users and anonymous users is different.
- The <title> tag in the head is not impacted by the change
Developer notes
https://gerrit.wikimedia.org/r/c/mediawiki/core/+/734420 would allow editors to remove the page title from the main page by blanking the page MediaWiki:Mainpage-title
Changes in Vector and Minerva would then be made to check for an empty string
e.g.
<h1 id="firstHeading">{{{html-title}}}</h1>
becomes
{{#html-title}}}<h1 id="firstHeading">{{{.}}}</h1>{{#html-title}}}
Inside Minerva, we'd need to refactor SkinMinerva::getHeadingHtml to use html-title after the core change has been merged and to address the <title> issue, we'd remove the code inside SkinMinerva::prepareHeaderAndFooter:
if ( $title->isMainPage() ) { $pageTitle = ''; $msg = $this->msg( 'mobile-frontend-logged-in-homepage-notification', $user->getName() ); if ( $user->isRegistered() && !$msg->isDisabled() ) { $pageTitle = $msg->text(); } $out->setPageTitle( $pageTitle ); } else
QA Results - Beta
AC | Status | Details |
---|---|---|
1 | ✅ | T255682#7558065 |
2 | ✅ | T255682#7558065 |
QA Results - Prod
Not Applicable