This module automatically adds predefined paragraph structures to content when a new entity is created. This helps establish a consistent content layout by populating fields with default content based on selected paragraph types. It also allows other modules to modify these default paragraphs before they are added.
Default Paragraphs module provides a widget for entity_reference_revisions field types, that allows us to select multiple paragraph types as defaults, so they will be added on the entity add page. it is based on Paragraphs EXPERIMENTAL widget.
The main use case is where we need to have a default content structure for a given entity type.
The paragraph types set as default would be shown as "closed" on entity add page by default, but for the case where given paragraph type has required fields it will be opened.
Default Paragraphs allows other modules to modify the paragraph entities by subscribing for an event called DefaultParagraphsEvents::ADDED. It is triggered right before they are set as default values of the widget. It provides the possibility to set default values to the paragraph entity's fields if needed.
It is useful when we have multiple paragraph reference field.
Usage:
- Install the module:
composer require drupal/default_paragraphs - Create multiple paragraph reference field for a given content type
- Make sure you have more than one allowed paragraph type for this field
- Go to
Manage form displaypage - Select "Default paragraphs widget"
- You can select now the default paragraphs type from the settings form
- When you go to add content page, the paragraph reference field will have the default paragraph entities pre-populated.
Releases
The 2.0.1 release is compatible with the 1.18 version of the Paragraphs module. For older versions of the paragraphs module, stick to 2.0.0
Dependencies:
- Paragraphs
Ask your assistant about Default Paragraphs
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.