backdrop-issues
backdrop-issues copied to clipboard
Incorporate Layouts UI to "manage displays" for entities
Description of the need
This is a follow-up to https://github.com/backdrop/backdrop-issues/issues/779#issuecomment-91397712 that deserves to be a stand-alone issue.
Keep in mind that we also have the Layouts UI that can be used in place of "Manage display" long term if what we end up wanting is drag-and-drop that includes laying out content on the page. Field configuration (Manage fields) could become the same pattern as adding and configuring a block.
Proposed solution
- An addition to the core blocks API:
- allow some blocks to be marked as "Full-page only"
- An addition to the core layouts API:
- allow some layouts to be marked "Full-page only" to indicate that they include things like header, footer, messages, page title, tabs, etc.
- All other layouts ("Mini Layouts") will provide only regions for elements to be placed. (The default region is required)
- New Mini Layout renderers:
- for edit:
- do not automatically add blocks for messages, page title, tabs, etc
- a modified list of available blocks "Full-page only" blocks like messages, page title, etc, should be excluded
- other changes may also be necessary
- for view:
- does not render any blocks for messages, page title, tabs, etc
- other changes may also be necessary
- for configure template:
- does not use
<header>and<footer>elements or add header / footer regions - other changes may also be necessary
- does not use
- for edit:
- In the Field UI
- On the default UI:
- add a toggle between "Render fields by weight" vs "Render fields via mini layout" (language TBD)
- For the New UI:
- Replace the "Manage display" interface with the edit renderer for mini layouts
- All fields rows should be replaced by field blocks (sans block markup?)
- place these in the "default" region by default
- On the default UI:
Alternatives that have been considered
- Display Suite
Additional information
There are several other modules that could benefit from these "mini layouts", and having a universal way to share them across modules would be ideal.
Draft of feature description for Press Release (1 paragraph at most)
Backdrop now includes...
This could go in at any time, but it could be a "big deal feature" suitable for 2.x!
One approach I was thinking of was creating a new base layout class that could include a property such as
->typewhich in this case could beflexibleand in the case of core layouts would simply belayout(and in other implementations could beparagraphsorfieldor ??). Of course, the current layout class couldn't be renamed but perhaps could retroactively extend the newBaseLayout(or whatever) class.
Quoted from a comment over here.
Doing this would allow us to use the type value in the config name fairly seamlessly (e.g. layout.layout.whatever.json, layout.flexible.whatever.json, etc.)
(EDIT: I created a new issue that fleshes out this proposal - https://github.com/backdrop/backdrop-issues/issues/6434)
I'm working on a presentation for Midcamp about the differences between Layouts in Drupal and Layouts in Backdrop. One major difference is that once the Layout Builder is enabled for Drupal, one can enable a custom layout for a content type on the Manage Displays page.
Once this has been done, you have the option to manage "manage layout" for that content type. If you click on this button, you see a layout for that page with all of the field blocks positioned in their default positions, with the ability to create new regions and drag and drop them.
While in theory, this is possible in Backdrop CMS, one can not do this from the content type configuration. One must move to the layouts UI, create a layout, give it the correct context, give it the correct visibility rule, and then discover that there are field blocks available that can be placed for that content type and place them.
While, we could completely integrate the layout UX in the manage display page for a content type. Another eaiser option MIGHT BE, to simply provide a link/button for each custom content type which says - create a custom layout for this content type.
Clicking on this link, automatically opens the Layout UI, with a new layout preconfigured with the proper context and visibility rules and all the field blocks enabled for that content type.
(This is very much stream of consious late at night, before giving my presentation tomorrow. I may need to come back and clean this up later, but I hope it at least gets the idea out there.)
Should this be it's own new issue or does it make sense as one way to address the current issue?
I think your idea is a good one @stpaultim but it does seem like a different idea from this issue. Yours is about having more of a "wizard" or generator for the current layout builder.
@herbdool I created this new issue: https://github.com/backdrop/backdrop-issues/issues/6434 - Now https://github.com/backdrop/backdrop-issues/issues/2894