Part of a family of issues at
🌱
[META] Decouple layouts from themes
Active
Problem/Motivation
It is not possible to use the Drupal 8 layouts in any way in Drupal core now. The proposed conditional page system (
#1787942: Allow assigning layouts to pages →
) was deemed a usability issue because you could not actually create pages with it, you could assign layouts to existing page patterns with conditions. Therefore we need a simpler way of just creating blank pages. The term "landing pages" has been changed to "blank page" because it is laden with connotations related to marketing conversion funnels. This issue is simply about creating one-off pages like an "about us" pages or a "Terms and conditions" page or any other stand-alone page that does not neatly match a content type or view and is not necessarily a marketing "landing page".
Proposed solution
The "free form" page entity type solves at least that half of the problem. The other half, how the user "lays out" the pages can, of course, now be handled by the theme system with twig but I think that this is not an ideal solution for site builders, managers and editors. Indeed many modules have been built to allow the site builder to "lay out" the content well. That is the cowpath we should be paving here. Providing a straightforward way for the content editor or site manager to lay out a one-off page in-place and without code.
This could be done with the following:
- Create the default "blank page" entity type with only a title and a body field
- Set the default route for content creation for entities of that type to the front end—not the admin theme—enabling the user to lay out the page as it will be displayed
- As an example for site builders and themers, create a twig template for the entity type in bartik theme with an edge-to-edge content region with no sidebars following the paradigm of panels
- Create a default view mode applied to that entity type in which the title field is tokenized and embedded into the html of the body field.
- Extend edit module to enable it to edit the embedded title in-place (and at a later point, possibly any field the user adds to the type)
- Provide a lightweight Drupal-specific plugin to CKeditor and corresponding Drupal module that makes CKblocks responsive and draggable
Admittedly this solution potentially creates a kind of "two tiered" layout system in which laying out the content well is done in a different way than laying out the regions and blocks of the site, but on a great many Drupal 7 sites that roughly mirrors the current reality. These two tasks: laying out the site and laying out a page are performed today by two different users with different skillsets therefore matching UI patterns are less important.
Note: 4 and 5 are not absolutely essential to achieve the goal but would be nice and open doors to other things. MVP ia a responsive layoutable-in-place full-width body field.
Related issues
The final will depend on capabilities introduced with
#1839278: Add layout template demonstration →
and
#1817044: Implement Display, a type of config for use by layouts, et. all →
, however neither is in core.