Problem/Motivation
Currently layout_builder is very limited when it comes to more complex layouts. The issue is lack of nesting or wrapping ability. See:
I believe that all use cases bringing people towards these issues could be solved if we would simply allow people to create layouts with configurable regions. These could be a "second class citizens", yet would allow devs or contrib modules to develop custom complex rules of layout building, and store them in layouts configurations.
Proposed resolution
The simplest way of supporting this would be to add a new method to the Drupal\Core\Layout\LayoutInterface
: getDynamicRegions
. Other parts of the system could decide themselves if they want to support dynamic layout regions or not, as this information is not always available, but where it is available, it is very useful.
Remaining tasks
- Patch review
- Discuss and agree on the solution
API changes
Drupal\Core\Layout\LayoutInterface
modified with additional method. It would be implemented by default in the Drupal\Core\Layout\LayoutDefault
though.