Skip to content

Feature request: optional media metadata persistence (alt, caption, copyright, tags) #90

@BriceFab

Description

@BriceFab

Summary

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:

  • MediaRecord (path, library, alt, caption, copyright, tags, createdAt, updatedAt)

Potential integrations:

  1. Resolver API to fetch metadata from path.
  2. EasyAdmin media library UI to edit metadata.
  3. Twig helpers/components to render alt/caption fallback from metadata.
  4. Move/delete listeners to keep metadata rows consistent with media path changes.

Additional benefit: safer deletion when media is linked

With a metadata/entity layer, the bundle could also provide native usage checks before deletion, for example:

  • prevent deleting a media if it is linked to one or more entities (RESTRICT behavior)
  • show where it is used before confirming deletion
  • optionally offer SET_NULL / detach strategies depending on configuration

This would make media management safer for editors and avoid broken content after accidental deletes.

Why this matters

  • Better accessibility and SEO at scale.
  • Reusable metadata across pages/components.
  • Less custom boilerplate in each project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions