Page MenuHomePhabricator

Allow access to the page's short 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

Gonnym created this task.Feb 17 2019, 2:21 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 17 2019, 2:21 PM
Reedy added a subscriber: Reedy.Feb 18 2019, 8:50 AM

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.

Pppery awarded a token.Nov 5 2019, 3:33 AM
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.