Note: This page is out of date. See the current Layout API documentation
for Drupal 8.3.x+.
For Drupal 8.0.x-8.2.x, the Layout plugin module allows modules or themes to register layouts, and for other modules (like Panels or Display Suite) to use them.
Instead of using Layout plugin in Drupal 8.3.x core, new modules Field Layout and Layout Discovery are now available experimentally. More info on the 8.3.x release post.
Transitioning to experimental modules from layout plugin in Drupal 8.3.x
At this time, Layout Plugin and Layout Discovery cannot be run at the same time in a Drupal 8.3.x instance. (See issue: #2867795: White screen (WSOD @ Drupal 8.3) ERROR: Cannot use object of type as array )
Try the following process to move to the experimental modules:
- Remove or at least uninstall any contrib product that relies on Layout plugin;
- Uninstall (maybe even delete) layout plugin
- Update database schema.
It is best to use the 4.x branch of the following modules when completing this transition:
- Display Suite 8.3.x (beta version available).
- Panels 8.4.x (in development).
- Panelizer 8.4.x (beta version available).
For more info see issues: #2811175: [plan] Add layouts to Drupal and #2867795: White screen (WSOD @ Drupal 8.3) ERROR: Cannot use object of type as array
Possible issues:
- Names changing for bundled layouts, e.g. "onecol" changes to "layout_onecol"; this can be handled via an update script.
- API changes for custom integrations; this needs documentation.
Developer documentation
- How to upgrade from layout plugin to Layout API / Layout discovery inside main API documentation area.
- How to render layouts, the new way in 8.3.x.
- See the change record on the Layout plugin and on layout_discovery for more information.
- More info on Registering layouts
- Using layouts.
- New 8.3.x layout_discovery API documents
Comments
There is no disable choice in
There is no disable choice in Drupal 8, So the only way to update to Layout Discovery is completely delete it, then rebuild the same function with the new version module.
Chinese drupal tutorials Think in Drupal
"Disable" above should be
"Disable" above should be "uninstall", thanks! I'll update this.
The contributed Layout Plugin
The contributed Layout Plugin module is also now obsolete. For documentation on the core Layout API, see:
https://www.drupal.org/docs/8/api/layout-api