I have a taxonomy vocabulary with 'Countries' as parents and 'Cities' as children. I want to expose the terms with two views exposed filters,one for the parents and one for the children.But both filters show all parents and children terms. How can I accomplish that,to show only parents term to one filter and children terms to the other filter? Thanks in advance

  • Anyone please answer on this? – sokratis Mar 16 '12 at 15:36

Option 1:

Use Hierarchical Select module and you can show the related child term whenever you select the parent. (For example if you select the country UAE, then it shows the UAE cities like dubai, abu-dhabi,..). See the below screenshot for how it works.

enter image description here

If i select the community "Downtown Burj Dubai", it automatically loads the another list of child terms for Downtown Burj Dubai.

enter image description here

Option 2:

You can also try Simple hierarchical select. Unlike Hierarchical select this module provides a simple widget for taxonomy terms only. As an addition Simple hierachical select works as Views exposed filter.


http://drupal.org/sandbox/ser_house/1832320 is not done but i am using it on my site and works fine even with other exposed filters.

Only problem not really related to this module is that my vocabulary is 5000+ terms and its Drupal taxnonomy core issue on how to handle large amount of terms.

  • 1
    I have enabled this module,but I don't know that to do next,can you help me? – sokratis Mar 12 '13 at 16:15
  • the link of page you put it is not work"Page not found" – Rasha Shareef Apr 7 '13 at 9:08
  • @BigBrother2010 link broken – Bala Jun 10 '13 at 10:32
  • @azz.kawa Link not found – Umair Jan 25 '18 at 3:21
  • @sokratis The sandbox link is not working. Can you share the module with us? – Umair Jan 25 '18 at 10:45

Here Depth means-The depth will match nodes tagged with terms in the hierarchy. For example, if you have the term "COUNTRIES" and a child term "CITIES", with a depth of 1 (or higher) then filtering for the term "COUNTRIES" will get nodes that are tagged with "CITIES" as well as "COUNTRIES". If negative, the reverse is true; searching for "CITIES" will also pick up nodes tagged with "COUNTRIES" if depth is -1 (or lower).

this can be of help if u don't mark any node with the COUNTRIES tag,but mark all nodes with the some children tags of COUNTRIES.

The Views module has a taxonomy_term View which can be used. You need to edit the View so that under the Arguments -> Taxonomy: Term ID (with depth) -> change the depth depending on your requirement. If you want to exclude the parent item, you can do this by adding a filter to exclude the parent term.

I found a link as well that might help: Display terms only if associated with a node

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.