I'm building a Drupal 10 View to display a block of related taxonomy terms.
Here's the setup:
View Type: Taxonomy term view. Display: Block. Block Placement: This block will be displayed on taxonomy term pages, with the URL pattern /taxonomy/term/%. Taxonomy Vocabulary: Let's call this vocabulary degree_area_study. Custom Field: All terms within the degree_area_study vocabulary have an entity reference field named field_related. This field references other taxonomy terms.
My Goal:
I want to display all taxonomy terms that meet the following criteria:
They have the same value in field_related as the taxonomy term currently being viewed on the page (/taxonomy/term/%). They belong to the same vocabulary (degree_area_study) as the taxonomy term currently being viewed. The term currently being viewed should not be included in the results. What I've tried so far:
I've set up the View as a Taxonomy term view. My current approach involves:
Adding a Relationship: I've been trying to use a relationship related to field_related. I'm specifically looking for the "Taxonomy term: using field_related" relationship. Adding Contextual Filters: One contextual filter to get the term ID from the URL (/taxonomy/term/%). I set it to "Provide default value" from "Taxonomy term ID from URL" and "Load default filter from taxonomy term page". Crucially, I set its Relationship to the field_related relationship (e.g., field_related (Relación)). I also set it to "Exclude" the current term. Another contextual filter for "Taxonomy term: Vocabulary". I set it to "Provide default value" from "Taxonomy term ID from URL", "Load default filter from taxonomy term page", and "Field to use for load: Vocabulary of the term". For this filter, the Relationship is set to "None". Enabling "Distinct" in the Query Settings to prevent duplicates.
The Problem:
Despite these configurations, the View is not working as expected. I'm either getting no results, incorrect results, or results that are still duplicated.
I suspect the issue lies in the precise configuration of the Relationship (especially distinguishing between "referenced from" vs. "using") and how the Contextual Filters are applied in conjunction with that relationship, particularly for a Taxonomy Term base view.
How do I correctly configure the Relationships and Contextual Filters in a Drupal 10 Taxonomy Term View to achieve this specific filtering logic?