Skip to main content
drupalreleases
Release: Cms 2.2.3 — Update released for Drupal core (2.2.3)! Release: Easy Breadcrumb 2.0.11 — Minor update available for module easy_breadcrumb (2.0.11). Release: Bootstrap 8.x-3.42 — Minor update available for theme bootstrap (8.x-3.42). Release: Search API attachments 10.0.13 — Minor update available for module search_api_attachments (10.0.13). Release: Editoria11y Accessibility Checker 3.0.10 — Minor update available for module editoria11y (3.0.10). Release: Editoria11y Accessibility Checker 2.2.24 — Minor update available for module editoria11y (2.2.24). Release: Mismatched entity and/or field definitions 1.2.1 — Minor update available for module meaofd (1.2.1). Release: Lupus Custom Elements Renderer 2.8.1 — Minor update available for module lupus_ce_renderer (2.8.1). Module Revived: Bootstrap 8.x-3.41 — Theme bootstrap updated after 6 months of inactivity (8.x-3.41). Security Coverage: Component Library — Module component_library now has official Drupal security advisory coverage.

Views Reference Filter

10,724 sites Security covered Drupal 8–9 · not 10, 11
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.

Depends on

Dependencies of the latest stable release

  • views Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
11
Tracked since
May 2023
Latest release
1 day ago
Releases (12 mo)
4 ▲ from 2
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
2.0.0-beta9 Pre-release 10–11 Oct 6, 2026
2.0.0-beta8 Pre-release 10–11 Sep 8, 2026
2.0.0-beta7 Pre-release 10–11 Jun 27, 2026
2.0.0-beta6 Pre-release 10–11 Jun 25, 2026
2.0.0-beta5 Pre-release 9–11 Dec 15, 2024
2.0.0-beta4 Pre-release 9–11 Dec 15, 2024
2.0.0-beta3 Pre-release 9–10 Sep 18, 2023
8.x-1.5 Stable 8–9 Aug 23, 2023
2.0.x-dev Dev Jul 2, 2023
2.0.0-beta2 Pre-release Jul 2, 2023
2.0.0-beta1 Pre-release May 24, 2023