Drupal is a registered trademark of Dries Buytaert

paragraphs_media_icons

9 sites No security coverage
View on drupal.org

Eliminates config bloat by replacing Paragraphs' base64-encoded icons with Media entity references. Reduces config size by 90%+.

The Problem
The Paragraphs module stores paragraph type icons as base64-encoded images inside configuration YAML.
On sites with 60–80 paragraph types, this can inflate config exports to 50–60 MB, slow drush cex to minutes, and generate unreadable git diffs.

The Solution
This module replaces config-stored icons with Media entity references using Drupal’s third-party settings API.
A 15–50 KB base64 blob becomes a simple integer Media ID—reducing each paragraph type’s config by ~99%.

Key Features
90–95% config reduction (e.g., 60 MB → 2–3 MB)
One-command migration (drush pmi:migrate)
Full Paragraphs Previewer support (Modal, Dropdown, Buttons)
No UX changes—icons display exactly the same
Standards-compliant: uses third-party settings API
Faster config exports and clean git diffs

How It’s Different
Rather than modifying config entities (which breaks validation), this module:
Extends ParagraphsType to override getIconUrl()
Stores Media IDs via third-party settings
Ensures complete compatibility with Paragraphs Previewer and related modules

Technical Overview
Entity override for icon URLs
Media ID stored as config, not file data
Migration service converts existing icons
Hook integrations for seamless widget support

Installation
Requirements: Drupal 11.3+, PHP 8.1+, Paragraphs, Media

Enable: drush en paragraphs_media_icons -y
Clear cache: drush cr
Works immediately—no additional setup required.

Usage
Go to Structure → Paragraphs types
Edit a type and use the Media Icon field
Select an image from the Media Library

Save
Icons appear wherever Paragraphs icons normally display.

Drush Commands
pmi:stats — Shows config bloat and icon usage
pmi:migrate — Converts all base64 icons to Media entities (safe to run multiple times)

Migration Workflow
drush pmi:stats
drush pmi:migrate
drush pmi:stats # should show 0 MB bloat
drush cex
git commit -m "Migrated paragraph icons; reduced config size"

Security
Uses Drupal’s Entity API
Respects Media access permissions
No raw SQL
Follows Drupal coding standards

Activity

Total releases
1
First release
Feb 2026
Latest release
3 weeks ago
Release cadence
Stability
100% stable

Releases

Version Type Release date
1.0.0 Stable Feb 6, 2026