Page MenuHomePhabricator

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

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.

Related Objects

StatusSubtypeAssignedTask
Declineddchen
OpenNone
OpenNone
DuplicateNone
OpenNone
OpenNone
OpenNone
StalledNone
OpenNone
DuplicateNone
ResolvedNone
OpenNone
OpenNone
OpenNone
OpenNone
ResolvedNone
ResolvedNone
OpenNone
StalledNone
OpenNone
OpenNone
OpenNone
OpenNone
Resolveddaniel
Resolveddaniel
OpenNone
OpenNone

Event Timeline

daniel triaged this task as Medium priority.Sep 25 2018, 4:47 PM
daniel created this task.

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

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

daniel added a project: User-Daniel.