Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

This module adds a new filter to Views, allowing you to filter media items by their taxonomy terms, including sub-terms. It provides the functionality of the "Content has taxonomy term ID (with depth)" filter directly for media entities.

This lightweight module is trying to solve the problem that Views filter named "Content has taxonomy term ID (with depth)" is available only for nodes and can not be used for media entities.

Related issue in Drupal Core : Views should support - Entity: Has taxonomy term ID (with depth) - for entities

The Module extends Taxonomy module from Drupal core and provides a new filter "Media has taxonomy term ID (with depth)".

Compared to the Taxonomy module that uses relationship table "taxonomy_index" between terms and nodes, this module uses only SQL query on existing tables. Module needs to know the name of your reference field. You must specify the field in the filter settings.

How to use

  1. Go to your Media Views -> Advanced -> Contextual filters -> Add -> Media has taxonomy term ID (with depth)
  2. In Reference field: Enter a machine name of the field in the media entity type, which is referencing to a taxonomy

Most of this module code comes from Commerce: Product taxonomy filter. A big thanks to this project maintainers.

8.x-1.x vs 8.x-2.x

Drupal core 8.6 introduces modifications in taxonomy table in database.
Use 8.x-2.x version of this module if your drupal core version is >= 8.6

Activity

Total releases
1
First release
Aug 2025
Latest release
10 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Slowing

Releases

Version Type Release date
3.0.0-beta2 Pre-release Aug 20, 2025