Repository navigation
Media Library: support categories, tags and custom taxonomies on media #5146
ralphwest1
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
Taxonomies can only be attached to collections, and the Media Library is not a collection, so there is no way to put categories, tags, or a custom taxonomy on a media item.
Folders are the only way to organize media today, and each file can be in only one folder. That means I can't give one image several labels (for example product line and use case), I can't filter the library or the media picker by term, and templates can't query media by term the way
getEntriesByTermworks for content.One possible shape: let the Media Library be selected as a target when creating or editing a taxonomy, show the taxonomy panels in the media detail view, add term filters to the library and the picker, and add a query helper for media by term.
Prior art in WordPress: WordPress attachments can take any taxonomy through
register_taxonomy_for_object_type(), but core has no interface for it, so plugins fill the gap. Enhanced Media Library (about 70,000 active installs) and Media Library Assistant add categories, tags and custom taxonomies to media, with filters in the library and media picker. The most popular media plugin, FileBird, uses folders instead, and EmDash already covers that case. The gap is that a single file can't carry several labels at once.Migration: The WordPress importer skips assignments for taxonomies that have no matching EmDash definition. A site that tags its media with one of these plugins would likely lose those tags when it moves to EmDash, because there's nowhere to put them.
Use case
I build marketing sites for small manufacturers with large libraries of product photos. Editors need to tag each image by product line, finish, and application, then find images by tag when picking media for a page.
On the public site I want to render image grids filtered by term, such as a portfolio or gallery page that shows only one product type, without creating a content entry for every photo.
This affects editors (finding the right image in a large library) and developers (building filtered galleries).
Current workarounds
The workaround is a wrapper collection (for example
photos) with an image field and the taxonomies attached to it. It works, but every upload needs a matching entry created by hand, the two can drift apart, and the wrapper entries don't appear in the media picker, so editors still pick from an untagged library.A plugin doesn't seem able to cover it:
taxonomies:writechecks that the taxonomy is attached to the target collection, and media isn't a collection, so a plugin can't assign terms to media items. Plugin data could store tags separately, but the admin library and picker couldn't filter by them.Your involvement
All reactions