Skip to content

Add a block render function outside layouts #6893

Open
backdrop/backdrop
#5076
@bennybobw

Description

@bennybobw

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions