Page MenuHomePhabricator

Allow SlotRoleHandlers to control page layout
Open, Needs TriagePublic

Description

The Layout of the output returned by RenderedRevision::getCombinedParserOutput() should be based on the layout hints returned by the respective SlotRoleHandlers.

Implementation notes:

For SlotRoleHandlers to control the layout of the output returned by RenderedRevision::getCombinedParserOutput(), RevisionRenderer should inject a callback into RenderedRevision that can be used to combine the ParserOutputs for the individual slots. That callback would in turn call code in RevisionRenderer that would use the SlotRoleRegistry to get the appropriate SlotRoleHandlers, and ask them for layout hints.

Option for more flexible layout:
We could replace getOutputLayoutHints with getOutputLayout, which returns a list of "chunks", each containing an HTML string and layout hints. This way, slots could put output in multiple locations of the layout. How the SlotRoleHandler extracts the "extra bits" from the ParserOutput is specific to the slot and content model - it could be done by parsing the HTML, or using getExtensionData, or some other mechanism.

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
OpenNone
Resolveddaniel
InvalidTgr
ResolvedAnomie
ResolvedAnomie
OpenNone
Resolveddaniel
Resolveddaniel
OpenNone
OpenCCicalese_WMF

Event Timeline

daniel created this task.Aug 1 2018, 4:11 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 1 2018, 4:11 PM
daniel updated the task description. (Show Details)Dec 12 2018, 4:31 PM
WDoranWMF moved this task from MCR to mop on the Core Platform Team board.Fri, Jul 26, 6:38 PM