You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support an optional metadata layer for media (alt, caption, copyright, tags) in JoliMediaBundle.
Context / use-case
In real websites, media are not only file paths: editors need reusable metadata for SEO/L+JSON and editorial quality:
alt text
caption / legend
copyright / credits
tags / categorization
Typical example: gallery photos attached to pages, services, or products.
Today, JoliMedia stores media as filesystem paths and Doctrine media / media_long fields in entities. This works well for storage and transformations, but there is no native place to store reusable editorial metadata per media.
Current workaround
Projects must create a custom entity layer (e.g. MediaAsset, ServiceGalleryImage) to map media paths and metadata, then maintain custom forms, synchronization, and deletion behavior.
Proposal
Introduce an optional metadata persistence model in the bundle (or a bridge package), for example:
I am currently implementing this feature on a fork, and I would like to propose it as a pull request. Before opening it, I would appreciate your feedback on the following design.
Opt-in configuration. A new joli_media.metadata section, disabled by default. When disabled, the bundle behaves exactly as today and requires no additional dependency.
Storage. Metadata is accessed through a MetadataStorageInterface. A Doctrine ORM implementation would be shipped, storing one record per library and path, with alt, caption, copyright and tags. Other storages, such as a sidecar file on Flysystem, could be added later behind the same interface.
Rendering. New Twig filters in the existing extension (joli_media_alt, joli_media_caption, joli_media_copyright, joli_media_tags). The Img and Picture components would use the stored alternative text when no alt attribute is provided; an explicit alt, including an empty one for decorative images, always takes precedence.
Administration. In the EasyAdmin bridge, a metadata form on the media detail page, an indicator for images without alternative text, and a tag filter in the media list.
Consistency. Metadata follows moves and renames, and is removed with the media, within the existing move and delete listeners.
Usages. Optionally, and possibly as a separate pull request: listing where a media is used, based on the MediaType columns found in the Doctrine mapping and on a MediaUsageProviderInterface for other references, and displaying these usages when a deletion is refused.
This first contribution would only cover the EasyAdmin bridge. The core (storage, Twig filters, listeners) would remain bridge-agnostic, so that the Sonata and Sylius bridges could build on it later. I am of course open to adjusting naming, scope and structure to fit the project’s conventions.
Thanks for working on this! I’ve implemented a similar layer on top of JoliMedia with Doctrine entities, stable IDs, metadata, tags, EasyAdmin integration and reference tracking.
The opt-in architecture and MetadataStorageInterface look good.
A few points to consider:
Referential integrity: handle moves, renames and replacements without breaking metadata associations.
Usage tracking: support Doctrine media / media_long fields and extensible references via MediaUsageProviderInterface.
Deletion guard: enforce RESTRICT at the core level, independently of EasyAdmin.
I agree that usage tracking could be a separate PR to keep the initial scope focused.
Activity
charliefancelli commentedon Oct 23, 2026
Hello, and thank you for this bundle.
I am currently implementing this feature on a fork, and I would like to propose it as a pull request. Before opening it, I would appreciate your feedback on the following design.
Opt-in configuration. A new joli_media.metadata section, disabled by default. When disabled, the bundle behaves exactly as today and requires no additional dependency.
Storage. Metadata is accessed through a MetadataStorageInterface. A Doctrine ORM implementation would be shipped, storing one record per library and path, with alt, caption, copyright and tags. Other storages, such as a sidecar file on Flysystem, could be added later behind the same interface.
Rendering. New Twig filters in the existing extension (joli_media_alt, joli_media_caption, joli_media_copyright, joli_media_tags). The Img and Picture components would use the stored alternative text when no alt attribute is provided; an explicit alt, including an empty one for decorative images, always takes precedence.
Administration. In the EasyAdmin bridge, a metadata form on the media detail page, an indicator for images without alternative text, and a tag filter in the media list.
Consistency. Metadata follows moves and renames, and is removed with the media, within the existing move and delete listeners.
Usages. Optionally, and possibly as a separate pull request: listing where a media is used, based on the MediaType columns found in the Doctrine mapping and on a MediaUsageProviderInterface for other references, and displaying these usages when a deletion is refused.
This first contribution would only cover the EasyAdmin bridge. The core (storage, Twig filters, listeners) would remain bridge-agnostic, so that the Sonata and Sylius bridges could build on it later. I am of course open to adjusting naming, scope and structure to fit the project’s conventions.
damienalexandre commentedon Oct 30, 2026
I would like a feature like this as well.
The MetadataStorageInterface looks good 👍
BriceFab commentedon Oct 31, 2026
Thanks for working on this! I’ve implemented a similar layer on top of JoliMedia with Doctrine entities, stable IDs, metadata, tags, EasyAdmin integration and reference tracking.
The opt-in architecture and MetadataStorageInterface look good.
A few points to consider:
I agree that usage tracking could be a separate PR to keep the initial scope focused.
Happy to review the PR!