Drupal is a registered trademark of Dries Buytaert
Release: Leaflet 10.4.11 Minor update available for module leaflet (10.4.11). Release: Session Inspector 1.0.8 Minor update available for module session_inspector (1.0.8). Release: Migrate QA 2.0.4 Minor update available for module migrate_qa (2.0.4). Release: CKEditor Description List 3.0.0 Major update available for module ckeditor_descriptionlist (3.0.0). Release: FlowDrop 2.4.0 Minor update available for module flowdrop (2.4.0). Release: JWT Token Refresh 1.0.4 Minor update available for module jwt_token_refresh (1.0.4). Release: ConReg 1.0.0-beta1 First beta version released for module conreg (1.0.0-beta1). Release: AI Image Studio 1.0.0-beta8 New beta version released for module ai_image_studio (1.0.0-beta8). Usage Milestone: Statistics Counter Module statistics_counter crossed 1,000 active installs. Module Revived: Decoupled Router 2.0.7 Module decoupled_router updated after 11 months of inactivity (2.0.7).

Views Reference Filter

10,216 sites Security covered
View on drupal.org

Entityreference Filter extends Drupal's Views module to provide powerful filtering capabilities. It allows you to filter by various entity IDs, entity reference fields, and Search API indexed fields. Additionally, it enables dynamic, AJAX-powered dependent filters, allowing for complex cascading selections in exposed filters.

This module provides the views filter for entity ID or entity reference fields:

  • node ID
  • user ID
  • taxonomy term ID
  • the ID of any other content entity
  • entity reference field (Drupal core), including taxonomy term, node and user references
  • fields indexed in Search API

Exposed filter functionality

Taxonomy term filtering:
Imagine the following case - you have taxonomy terms in exposed filter widget (drop down select list). But for some reason you want to show just several terms, not all the dictionary. With this module, you can do this by creating a separate view which generates the desired list of terms.

The similar functionality is available for other type of fields - you create a separate view (or a new display of the same view) which returns the list of items to show in drop down select list of the exposed filter.

Unexposed filter functionality

This module provides the feature missing in Views module - subquery filter for IN (NOT IN) condition, such as (quite informal):
SELECT n.title FROM node n WHERE n.nid [IN | NOT IN] (SELECT n2.nid FROM node n2 WHERE ...)
or
SELECT n.title FROM node n WHERE n.node_reference_field [IN | NOT IN] (SELECT n2.nid FROM node n2 WHERE ...)
The view with the filter generates the outer query, and the separate view generates the inner query. Current implementation is simplified - it gets the result of the subquery and puts the concrete values in the outer query.

The limitations of the view and the display providing the items for the filter

  • the view display must be 'Entity Reference' type (provided by Drupal core Views)
  • the base entity of the view (which you select in the beginning of view creation) must be the same as the type of the field being filtered (node for nid field, user for uid field, etc.)

By default, the view receives the same arguments as the view being filtered. This can be changed in the filter settings.
Possible value for any argument:

  • the argument of the view being filtered
  • any string value
  • the value of any exposed filter of the view being filtered

The last option makes the exposed filter dependent on the other filter. This creates the functionality missing in the Views: dynamic dependent filters, i.e. when the value of the main filter is changed, the list of
options of the dependent filter is updated via AJAX. Filters can be chained into multi-level dependencies, and the cascade is resolved in order with cycle detection.

Activity

Tracked releases
2
Tracked since
Jun 2026
Latest release
1 month ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Active

Releases

Version Type Release date
2.0.0-beta7 Pre-release Jun 27, 2026
2.0.0-beta6 Pre-release Jun 25, 2026