0

I'm a Drupal noob, so this may be a simple question. I have two taxonomies created, one called Programs and another called Divisions. There is a "Division" field in the "Program" taxonomy. For example:

Programs

  • Math
  • English
  • Art
  • Communication
  • Biology

Divisions

  • Humanities
  • Science

Art, English, and Communication are all related to Humanities Math and Biology are related to Science

I have used Views to build a page that will display information for each program. URL format is academics/programs/biology, academics/programs/art, etc.

I'm trying to create a Views pane that will display related programs, but I'm having some difficulty. Essentially, I want it to a display a list of programs that have the same Division. How would I go about accomplishing this since the URL does not have the Division term in it, but rather the Program term?

Any help would be appreciated.

Thanks!

0

If you put the hierarchical structure into the path you could use a contextual filter to show the related programs in a view. The path would look like: programs/humanities/English

The contextual filter would look at the taxonomy term in position 2 and show related programs (other humanities programs in this example)

0

Instead of using taxonomy term as the field in programs rather use entity reference with taxonomy term and bundle divisions.

I also installed Views arguments in filters in order to get rid of listing the program in the second view. You can omit this if it is not a requirement.

Then set up your second view as follows (note I just used an attachment but you can alter as you like):

View: showing taxonomy terms filtered by Programs

Contextual filter: global null, default value = Taxonomy term ID from URL, Validator = Taxonomy term of Vocabulary Programs and Field filter type = Term name

Relationships:

Relationship 1: A bridge to the Taxonomy term entity that is referenced via field_division

Relationship 2: A bridge to the Taxonomy term entity that is referencing Taxonomy term via field_division, ans set its relationship to relationship 1

Fields:

Taxonomy term fields with the relationship set to relationship 2

Filter criteria:

Taxonomy vocabulary: machine name = Programs

Term Name: set the value to =%1 (picked up from global null via views arguments in filters

Term Name: set the value to !=%1 and add relationship 2.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.