Page MenuHomePhabricator

Allow access to the page's local description via the title object
Open, Needs TriagePublic

Description

Looking at the documentation here, the title object does not allow access to the page's short description. Currently (on en.wiki), in order to get the short description of a page that uses a nested short description template inside of another template (such an Infobox), title.getContent() is used and then the return article text is searched in order to find the short description text. Directly accessing the value from title.getDescription() would allow for a much cleaner code. Apologizes if there is already a task like this, but I couldn't find one.

Event Timeline

What do you mean the "page's short description"? Something provided by TextExtracts ?

I mean short description, the line of text that is associated with a page in search results and other places. I have no idea what TextExtracts, but looking at its documentation, it doesn't seem to be what I'm asking for.

Anomie added a subscriber: Anomie.

Probably via mw.ext.wikibase mw.wikibase then, rather than mw.title.

Just to be clear, I'm not trying to get the description located at wikidata, but the one at the local wiki. See this page information "Local description" section.

Tgr added a subscriber: Tgr.

Short description handling currently lives in Wikibase, so mw.wikibase makes sense nevertheless.

This should be reasonably easy, there's a service to return the description, it just needs some scaffolding to make it available to Lua.

Just to repeat myself, again, mw.wikibase is completely irrelevant to this, as is Wikidata. I'm not trying to access the description at Wikidata, for that I can use mw.wikibase.getDescription, which is already available. I'm trying to access the local description which can be seen either on the article itself, or in the "Page information" page. That can give a completely different description.

You can claim all you want it's not Wikidata/Wikibase, but it is. Look at the message keys used

wikibase-pageinfo-description-local is defined and used by MediaWiki-extensions-WikibaseClient

Reedy renamed this task from Allow access to the page's short description via the title object to Allow access to the page's local description via the title object.Nov 10 2020, 8:58 PM

Local descriptions are not touched by the Wikidata team so adding @EvanProdromou to get it on the right people's radar.