Question

Suppose if i have 2 vocabularies in which first vocabulary name is "Country" which contain some country names and Second is "Cities" which contain some cities names. If i want to select a particular country from "country" expose filter and i want that only few selected cities will automatically appear in "cities" expose filter. So that user dont have to go through all the list of cities of all the countries.

Is it possible with drupal views or any contributed module ? otherwise i have to do it with jquery hide/show .

Was it helpful?

Solution

I am posting answer to this question, as it might help somebody. I havent got any suitable module which can create relation between two taxonomy vocabularies as i want, But i have modified my taxonomy a little bit to do this from a module.

I have merged my 2 vocabularies into single . I have placed country as parent term and all the cities as sub-term. So my structure is like this :

India

  • Delhi
  • Rajashtan
  • Chandigarh
  • Gujrat

USA

  • Alabama
  • Alaska
  • Georgia
  • Illinois

Then I have used a simple module called "Simple Hierarchical Select" https://drupal.org/project/shs or you can also use Hierarchical Select" https://drupal.org/project/hierarchical_select But hierarchical select has more functions but if you have taxonomy related task only then you can use only SHS, as in my case.

Now go to the content type -> manage fields -> select term reference-> simple hierarchical select .

Now go to your views => select the "your-field-name" (hierarchical select ) from filters and force it to some depth.

Then it will show first country name and then child term which are city names.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top