Page MenuHomePhabricator

Create an API to set page props
Closed, DeclinedPublic

Description

The WikidataPageBanner api allows editors to create pages with a banner using PAGEBANNER magic word.
The information can be accessed via: https://en.wikivoyage.org/wiki/Special:ApiSandbox#action=query&format=json&prop=pageprops&titles=San+Francisco&ppprop=wpb_banner%7Cwpb_banner_focus_x%7Cwpb_banner_focus_y

It would be helpful to have an api or a framework in core to allow a shortcut for setting of these parameters without having to edit the underlying wikitext as then the iOS app could work out the correct values and save for wpb_banner_focus_x and wpb_banner_focus_y.

e.g.
https://en.wikivoyage.org/wiki/Special:ApiSandbox#action=setpageprop&format=json&titles=San+Francisco&ppprop=wpb_banner&ppvalue=NewFile.jpg

Event Timeline

phuedx raised the priority of this task from to Needs Triage.
phuedx updated the task description. (Show Details)
phuedx added subscribers: Aklapper, phuedx.

From an apps perspective I think having the ability to save/retrieve a "mainFocalPoint" for a given image would suffice.

Would this work for mobile web too?

@Mhurd: Absolutely. Especially given that the range of screen sizes we'd like to display these images on would mean we'd have to tinker with the cropping rectangle – presumable it'd be a rectangle.

phuedx renamed this task from Create an API to get and set cropping information for the lead image of an article to Create an API to get the lead image of an article.May 20 2015, 2:12 PM
phuedx renamed this task from Create an API to get the lead image of an article to Create an API to get and set cropping information for the lead image of an article.May 20 2015, 2:43 PM

Ignore me. Just… ignore me.

Prototyping this could inform T101098 and vice versa.

Jdlrobson renamed this task from Create an API to get and set cropping information for the lead image of an article to Create an API to get and set cropping information for the banner of an article.Nov 3 2015, 8:09 PM
Jdlrobson edited projects, added Wikidata-Page-Banner; removed MobileFrontend.
Jdlrobson renamed this task from Create an API to get and set cropping information for the banner of an article to Create an API to set page props.Jun 6 2017, 3:55 PM
Jdlrobson edited projects, added MediaWiki-Action-API; removed Wikidata.
Jdlrobson updated the task description. (Show Details)
Anomie closed this task as Declined.EditedJun 6 2017, 6:11 PM
Anomie added subscribers: Jdlrobson, Anomie.

@Jdlrobson renamed this task from Create an API to get and set cropping information for the banner of an article to Create an API to set page props.
@Jdlrobson updated the task description.

Page props, meaning the data in the page_props database table, comes from the parse and it would make absolutely no sense to have an API that tried to mess with the table directly. Nor does it make sense to create some strange pseudo-edit endpoint that tries to take the existing wikitext, mangle it, and re-save it—that sort of thing is best done client-side.

If you mean something else, feel free to retitle and redescribe the bug (and probably remove MediaWiki-Action-API).