Problem/Motivation
The layout module was removed in #2053879: Remove layout.module from core
We're not proposing adding it back in this issue, but instead just putting a very simple plugin manager for a layout plugin type into core.
Many modules need to declare or use layouts, for example: Display Suite, Panels, Layout, etc. We want to avoid the situation in D7 and earlier, where each module has their own silo'ed way of doing this.
We already have created the Layout Plugin module in contrib, which several modules (including Panels and Display Suite) have already standardized on and now have interchangeable layouts!
But we think it should be in core, in order to:
- Promote standardization on a single layout plugin type in contrib. It's sooo simple that it's almost a shame that it takes a whole module that other modules have to depend on. :-)
- Take the first little baby step towards adding more complete layout functionality in core. We're continuing to work on layouts in contrib, with modules like Tim Plunkett's Page Manager module, but once those have matured we'd like to progressively merge parts of it into core. This is the most minimal step in that direction.
Proposed resolution
Merge the functionality of Layout Plugin into core.
Personally, I'm not totally convinced it needs to be an independent module because it's just so simple! But to make declaring layouts simpler it does need to implement a couple hooks to automatically register layouts and libraries. Which probably means it needs to be a seperate module in core too - but we should discuss this.
In 'layout_plugin', layouts are declared in a .yml file and simply give a template and css file. Here's an example layout .yml file:
http://cgit.drupalcode.org/layout_plugin/tree/modules/layout_plugin_exam...
If you want to learn more about declaring layouts with layout_plugin here are the docs:
https://www.drupal.org/node/2578731
Remaining tasks
- Discuss and see if the core team would be open to this
- Implement a patch for review
User interface changes
In this proposal, there is no user interface!
API changes
This would include API additions (no changes) to support this plugin type, ex: LayoutPluginInterface
, LayoutPluginManager
, etc.