This project is not covered by Drupal’s security advisory policy.
Core Layout Builder does not support paragraphs. Thankfully Paragraph blocks module fills this gap. However, the authoring experience can be clunky when paragraph content needs to be added in the node edit form and its layout position is configured in the layout builder form.
This module aims to provide smoother authoring experience for using paragraphs with layout builder.
How is this module different than Layout Paragraphs?
Layout Paragraphs adds the ability to use and arrange paragraphs in content layout using its own code and it does not leverage on core Layout Builder. The advantage is that it can achieve nested layout while core Layout Builder still does not have nested.
This module tries to leverage on core Layout Builder as it should provide better support and compatibility with other Layout Builder modules. We have seen how ubercart vs commerce modules, or field_collection vs paragraphs module fared in the past. It is usually better to provide extended functionality to core features instead of building the system from scratch.
What are the limitations of this module?
- It does not support nested layout as long as core Layout Builder does not. Workaround: consider using mini_layouts or add more layout options a la radix theme.
- It completely replaces (hides) the core layout builder inline blocks with paragraphs in the layout builder interface.
- In 1.x the paragraphs are added to a fixed hardcoded field_contents field in the parent entity.
- In 1.x the paragraph population is still rather clunky: paragraph edit form opens in a separate page as we try to avoid the nested modal issue when for some CKEditor buttons or media library modal.
- Paragraph blocks is limited to 3.1.3 and need to apply patch for Paragraph blocks #3363519: Add proper check if there is no paragraph created yet in the entity
Roadmap
For 2.x:
- Make sure it's compatible with D10.
- Create field widget (tentatively) with its constraint (only one field widget type per bundle) that will recognise the field to add the paragraphs to.
- Leverage on other modules (like layout_builder_iframe_modal or layout_builder_modal) to provide the modal interface when editing the paragraph content.
- Work on the plugin filter hooks functions or leverage on other modules (perhaps block_list_override) to streamline the block filter at layout builder.
- Add some automated tests!
Credits
This module was first inspired by the presentation of Nathan Dentzau (nathandentzau) at NEDCamp 2019.
Requirements
This module requires the following modules:
- Core Layout Builder
- Paragraphs
- Paragraph blocks
Recommended modules
Some other modules that can improve the authoring experience of layout builder:
Installation
Install as you would normally install a contributed Drupal module. For further information, see Installing Drupal Modules. Recommended to install using composer.
Apply patch for Paragraph blocks #3363519: Add proper check if there is no paragraph created yet in the entity
Configuration
- Enable the module.
- Follow the instruction of Paragraph blocks to:
- set the maximum number of paragraphs to minimum 30
- check the "Suppress label field on layout manager block placement."
- use with the layout builder setting per entity
- Create some paragraph bundles if not available yet.
- Create content type with
field_contentsas the machine name for a paragraph field (entity reference revisions field), enable paragraph blocks for this field.
Project information
- Project categories: Content editing experience, Content display
- Ecosystem: Layout Builder
20 sites report using this module
- Created by loziju on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
