Page MenuHomePhabricator

Wikidata items render badly in Wikilabels
Closed, ResolvedPublic

Description

See http://labels-staging.wmflabs.org/ui/wikidatawiki/

The "item quality" campaign loads up Wikidata items. They look terrible. We're missing some important javascript/css.

Event Timeline

If you execute this in your console, it makes a big difference:

$('head').append('<link rel="stylesheet" type="text/css" href="https://www.wikidata.org/w/load.php?debug=false&lang=en&modules=ext.echo.badgeicons%7Cext.echo.styles.badge%7Cext.math.styles%7Cext.uls.pt%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikidata-org.badges%7Cext.wikimediaBadges%7Cjquery.wikibase.statementview.RankSelector.styles%7Cjquery.wikibase.toolbar.styles%7Cjquery.wikibase.toolbarbutton.styles%7Cmediawiki.legacy.commonPrint%2Cshared%7Cmediawiki.sectionAnchor%7Cmediawiki.skinning.interface%7Cskins.vector.styles%7Cwikibase.common&only=styles&skin=vector" />')

Still can't get the javascript itself to load.

@Ladsgroup, maybe you have an idea? We could also consider switching to an iframe.

In the meeting today, we talked about ?action=render and no-javascript mode for rendering items from Wikidata. We also discussed iframes, but agreed that they are icky.

The existing WikiLabels site is still not able to display references (see the attached)

Reference.PNG (700×1 px, 32 KB)

In addition, it still cannot display the termbox which provides labels, descriptions, and aliases for numerous languages.

I've been looking into this and we can probably do a bit more with the API.

With this, we can get the headers that are rendered on wikidata: https://www.wikidata.org/w/api.php?action=parse&oldid=424539371&prop=headhtml

I talked to @thiemowmde and it looks like an iframe might work best. Here's a way to get just the rendered content of a revision with all of the headers and goodies for an iframe: https://www.wikidata.org/wiki/?oldid=424539371&printable=yes

Change 343851 had a related patch set uploaded (by Thiemo Mättig (WMDE)):
[mediawiki/extensions/Wikibase] Disable editing in printable=yes mode

https://gerrit.wikimedia.org/r/343851

@Halfak : I think we can already close this ticket ?

Change 343851 merged by jenkins-bot:
[mediawiki/extensions/Wikibase] Disable editing in printable=yes mode

https://gerrit.wikimedia.org/r/343851