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:

  1. Install the module: composer require drupal/default_paragraphs
  2. Create multiple paragraph reference field for a given content type
  3. Make sure you have more than one allowed paragraph type for this field
  4. Go to Manage form display page
  5. Select "Default paragraphs widget"
  6. You can select now the default paragraphs type from the settings form
  7. 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
Supporting organizations: 

Project information

Releases