Page MenuHomePhabricator

Decide how SlotRoleHandlers can provide placeholders for missing slots
Open, NormalPublic

Description

SlotRoleHandlers should provide a way to show a placeholder when a certain slot is desired on a given page, but missing. This could be done in the following ways

  1. provide HTML (or a ParserOutput object) to represent the missing slot
  2. provide a dummy Content object to be show (and maybe even saved with the next revision)
  3. provide a message key that identifies a message to be shown when the slot is missing but desired.

The placeholder would be shown for all roles returned by getDesiredRoles() for a given title. However, the baseline implementation of getDesiredRoles() just returns [ 'main' ]. SlotRoleHandler could get an isDesiredOn( $title ) method, but this would require all slot handlers to be instantiated before getDesiredRoles() can return a value.

Using some kind of PageTypeHandler to define which roles are desired on a given page seems to make more sense.

Details

Related Gerrit Patches:

Related Objects

StatusAssignedTask
Declineddchen
OpenNone
OpenNone
DuplicateNone
OpenNone
ResolvedAbit
OpenNone
OpenNone
OpenNone
OpenNone
DuplicateNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
Resolvedppelberg
ResolvedKrinkle
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
Opendaniel
Resolveddaniel
Resolveddaniel
OpenNone
OpenCCicalese_WMF

Event Timeline

daniel triaged this task as Normal priority.Sep 25 2018, 4:47 PM
daniel created this task.
Restricted Application removed a project: Patch-For-Review. · View Herald TranscriptSep 25 2018, 4:47 PM
Cparle added a subscriber: Cparle.Sep 25 2018, 4:56 PM

SDoC use case:

When SDoC launches on Commons we will want to be able to add a MediaInfo item and its data to all File pages.

If there is *already* a MediaInfo item for a File page then it gets displayed, and can be edited. If no slot exists, however, then MediaWiki doesn't know that one is expected, and there is no way for the backend to display an empty slot to the user so they know that data is missing

Change 463076 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/core@master] MCR EXP Introduce placeholder output and PageTypeHandler.

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

Addshore moved this task from incoming to in progress on the Wikidata board.Oct 9 2018, 9:37 AM

One solution would be to yield control over the layout to a PageTypeHandler (T209924), and control over content rendering to the SlotRoleHandler.

greg added a project: Multimedia.Mar 7 2019, 10:59 PM
Restricted Application added a project: Multimedia. · View Herald TranscriptJul 14 2019, 3:19 PM
WDoranWMF moved this task from MCR to mop on the Core Platform Team board.Jul 26 2019, 6:40 PM