Description
Add a block render function outside layouts
There are contrib modules that render blocks programmatically, e.g. blockreference and insert_block, among others. Currently, LayoutRendererStandard
owns the renderBlock
method, meaning that third-party modules have to implement their own version of a block render function. For instance blockreference
implements _blockreference_get_renderable_array
and a variety of theme functions to get this working.
Proposed solution
Pull the code that renders blocks out of LayoutRendererStandard
and into the block module.
Alternatives that have been considered
Someone suggested implementing a Render class independendent of LayoutRenderer, but the block module approach seems more straightforward to me.