Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Paragraphs library browser filter

No security coverage Under active development

Part of the Paragraphs ecosystem · 88 projects

This module filters the "Add from library" paragraph browser to only show paragraph types that are allowed by the parent field. It also filters the type dropdown in the browser to match these allowed types, preventing users from adding paragraphs that are not permitted.

Note: this module is created by Github Copilot (with LLM model Claude Opus 4.6 - high thinking).

Filters the paragraphs library browser by allowed paragraph types from the
parent entity reference revisions field.

Problem

When adding a "From library" paragraph to an `entity_reference_revisions` field that restricts allowed paragraph types, the library browser modal shows all available library items regardless of the parent field's configuration. The exposed Type dropdown also lists all paragraph types.

Solution

This module ensures the library browser only shows library items whose paragraph type is allowed by the parent field. It also filters the exposed Type dropdown to match.

How it works

  1. Widget alter — When the `from_library` paragraph's `field_reusable_paragraph` widget renders, the module reads the allowed paragraph types from the parent `entity_reference_revisions` field and injects them into the entity browser's `widget_context`. This data is stored in the entity browser selection storage (keyed by UUID).
  2. Query alter — When the `paragraphs_library_browser` view executes, the module reads the allowed types from selection storage (via the `uuid` query parameter) and adds a `WHERE type IN (...)` condition to filter results.
  3. Exposed form alter — The Type dropdown in the exposed filter form is filtered to only show allowed paragraph types.

The `uuid` query parameter is preserved across Views AJAX requests (exposed filter submit, paging) because Drupal core's `ajax_view.js` forwards iframe query parameters to AJAX endpoints.

Requirements

Installation

  1. Place the module in your modules directory (e.g. `modules/custom/`).
  2. Enable it:
    drush en paragraphs_library_browser_filter
  3. Clear caches:
    drush cr

No additional configuration is required. The filtering activates automatically
for any `entity_reference_revisions` field that has allowed paragraph types
configured and includes the `from_library` type.

Ask your assistant about Paragraphs library browser filter

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

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Apr 2026
Latest release
5 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Core PHP Release date
1.0.x-dev Dev 10–11 Apr 22, 2026