Page MenuHomePhabricator

Wikidata shouldn't print two headings
Closed, DuplicatePublic

Description

Pre-HTML5 it was pretty much a cardinal rule that a page should only have a single h1 element. Post HTML5 you can have multiple ones but they should be semantically arranged to show their meaning.

I notice that Wikidata prints two h1's in the page in the same element. It hides the first one which is created automatically by Vector.

I suspect this is very bad for SEO and also rather hacky. I've seen the same problem in the Flow extension - the Flow team wanted to restyle the header but MediaWiki code didn't allow it - it's not malleable enough.

Let's make headings more configurable to avoid this. Maybe this is a method on the Title class or a simple template that can be configured in LocalSettings.php

It seems Wikidata needs to simply override the printable title so instead of saying "Q1" the heading says "Universe (Q1)". How can we support this better skin-experts?

Event Timeline

Jdlrobson raised the priority of this task from to Needs Triage.
Jdlrobson updated the task description. (Show Details)
Jdlrobson changed Security from none to None.
Jdlrobson subscribed.

Implementing a wikibase skin will not really help this. The current skin system is too restricted and would need to be changed to support you in this. Feel free to remove the Wikidata project if you don't want to track this work.

Ps. @Aklapper can we get a skins project? Certain things effect multiple skins not just Vector. How do I create a new project?

matmarex subscribed.

MediaWiki-User-Interface groups issues that affect all/most skins.

I've not looked at what Wikidata does, but it's easily possible to override page's displayed title using OutputPage::setPageTitle.

we do override with setPageTitle, but this is done in ViewEntityAction (i think in ContentHandler::getActionOverrides). for some reason, ViewEntityAction is not called at all in a mobile request.

If there was another hook we could use to override (and for setHTMLTitle), that would be better and no reason we need to do this in ViewEntityAction.

ViewEntityAction does seem to be getting called...

It seems FingerprintView::getHtmlForLabel is where the title gets added to the page. Ideally this should be replaced with a call to setPageTitle