media_views_filter
The Media Views Filter module provides a views text filter that allows filtering/searching by both media name and file name, as well as other media attributes.
The distinction between files and media is a "Drupalism" that is needlessly confusing for those new to Drupal. A file entity and a media entity each have their own name, but the media content views provided by Drupal core (for example at /admin/content/media) only allow filtering by media name, not file name. Meanwhile, the core files content view (at /admin/content/files) allows filtering by file name, but provides no way to edit the associated media entity(ies), and so no way to edit the file. What if a content editor is trying to find a file, but only remembers the file name, not media name? If you install this module, your content editors will thank you.
Features
- Provides a views text filter that allows filtering/searching by media name, file name, and media image alt text field/attribute.
- Provides a views field to display file name/path.
- Provides a views field to display media image alt text.
Post-Installation
Once installed, follow these steps:
- Edit a core media view (For example at: /admin/structure/views/view/media).
- Add a new filter criteria. Check the filter titled "Media name/file name" and click the Add and configure filter criteria button.
- Check "Expose this filter to visitors, to allow them to change it". Click the Apply button.
- Remove the original "Media: Name" filter.
- Save the view.
- Visit the view path. You can now filter media by both media name and file name as well as media image alt text.
Optionally, you may choose to include additional fields in the views output, such as file name/path and media image alt text. This will add more transparency to the way the filter works.
- Edit a core media view.
- Add a new field. Check the field titled "File name".
- Click the Add and configure fields button, then click the Apply button.
Optionally repeat the above steps, except add the "Alt text" field.
If you are using Drupal configuration synchronization (like you should), remember to export config when you're finished editing a view.