Paragraphs type groups
Part of the Paragraphs ecosystem · 85 projects
Paragraphs Type Groups lets a paragraphs field allow paragraph types through groups instead of a fixed list. A paragraph type declares the groups it belongs to, and a field allows one or more groups. A new paragraph type that declares a group shows up in every field that allows that group, without editing the field.
The configuration that provides a paragraph type and the configuration that provides the fields using it no longer reference each other. A recipe that ships a component and a recipe that ships a content type can be applied in any order, and neither needs to know about the other.
Features
- A Groups setting on the paragraph type form, stored as a third-party setting of the paragraph type.
- A Paragraph type groups reference method for paragraphs fields: pick the allowed groups, and the field allows every paragraph type in them.
- The field settings form lists the paragraph types the selected groups resolve to, and lets you drag them to set the order of the Add buttons.
- Works with the Paragraphs widgets: the handler extends the Paragraphs selection handler, so widgets and entity queries use the resolved list.
- Field configuration carries no dependency on the paragraph types it allows, which keeps recipes and config exports independent.
- Recipe friendly: a recipe can add groups to a paragraph type that another recipe provides with the core
setThirdPartySettingconfig action. - A field whose groups contain no paragraph type allows none, instead of falling back to every type.
- The module cannot be uninstalled while a field still uses its reference method.
Post-Installation
- Edit a paragraph type and fill in Groups with comma-separated machine names, for example
page_content, news_content. - Edit a paragraphs field, set Reference method to Paragraph type groups and select the allowed groups.
- Optionally drag the listed paragraph types to set the order of the Add buttons.
The README explains how to ship both sides from recipes.
Additional Requirements
- Paragraphs
- Entity Reference Revisions
- Drupal 11.1 or later
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.
More in the Paragraphs ecosystem
Most installed first