Score:0

Taxonomy dynamic dependent exposed filters

us flag

I have a content type with two taxonomy term fields: Region and Country.

I created some nodes and entered values for those fields. I created a view with both the fields as exposed filters. When a region is selected, is there a way to only to shown in Country all the related terms as shown in the screenshot?

screenshot

The project page for the Views Reference Filter module says, at the bottom:

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.

I couldn't make it work. It looks like it works only with entity reference fields.

Views AJAX Dynamic Dependent Exposed Filters looks promising, but it's using a lot of custom code that might be outdated.

Before I start to write custom code, may you suggest me any clean out-of-box idea?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.