Drupal is a registered trademark of Dries Buytaert

vtercf

19 sites Security covered
View on drupal.org

This Drupal 10 module provides a Views argument default plugin that allows you to retrieve the value of an entity reference field from the taxonomy term currently being viewed. This is particularly useful for creating contextual Views that filter terms based on a related entity associated with the current term.

Purpose

When building Views in Drupal, you often need to filter results based on the context of the current page. If you are on a taxonomy term page and that taxonomy term has an entity reference field (e.g., referencing a specific content type, user, or another taxonomy term), this module enables you to use the value of that entity reference field as a default argument for a Views contextual filter.

Usage Example

Let's say you have a taxonomy vocabulary called "Product Categories" and each category term has an entity reference field named `field_featured_product` that references a "Product" content type. You want to display a list of "Featured Products" related to the current category when a user visits a "Product Category" taxonomy term page.

Here's how you can achieve this using the VTERCF module:

  1. 1. **Ensure that your Taxonomy term has en Entity Reference Field**
  2. 2. **Create a View:**
    * Go to `Structure > Views > Add new view`.
    * Select Taxonomy Term in Show Views Options.
  3. 3. **Add a Contextual Filter:**
    * In your View, under the "Advanced" section, click "Add" next to "Contextual filters".
    * Select the entity reference you want to use to filter the list of terms.
    * **Crucially, configure this contextual filter as follows:**
    * When the filter value is NOT available: Select "Provide default value".
    * From the "Type" dropdown, choose **"Entity reference field from current term"**.
    * In the "Entity reference field name" text box, enter the machine name of the entity reference field on your
    *taxonomy term* (e.g., `field_featured_product`).
    * Apply (and save) your View.

Now, when you visit a "Product Category" taxonomy term page (e.g., `/taxonomy/term/123`), the View will automatically use the value from the `field_featured_product` on that specific taxonomy term to filter and display the corresponding featured products.

Activity

Total releases
4
First release
Jun 2025
Latest release
8 months ago
Release cadence
1 day
Stability
100% stable

Release Timeline

Releases

Version Type Release date
1.0.3 Stable Jul 1, 2025
1.0.2 Stable Jun 28, 2025
1.0.1 Stable Jun 28, 2025
1.0.0 Stable Jun 28, 2025