How To Implement Drupal Taxonomy with Hierarchical Select ?

  0 comments

One of our developer wanted to create a taxonomy of Countries, State and City.

For example, you might choose United States, then California, then Los Angeles. Or you might choose India, then Tamilnadu, then Chennai.

In this blog, we'll use the Hierarchical Select module to achieve it.

  • Firstly, you need to arrange your taxonomy. I've a simple example here with Countries, State and Cities, but you'll probably add a lot more terms.

    Add terms image

  • Now, install Hierarchical Select: https://www.drupal.org/project/hierarchical_select module
  • Create a new field in any content type. Choose "Term Reference" then "Hierarchical Select" and Save.

    add hierarchical select image

  • Click on Hierarchical Select Widget.

    Click hierarchical image

  • Select radio button next to Hierarchical Select configuration according to your requirement.

    Hierarchical configuration

  • Enter lebel next to Level labels

    Level labels

  • Finally, click "Add content" and use your field. Here's how the top level will look:

    Tax top

  • And, once the first level has been selected, here's how the second level will look:

    Tax mid Image

  • And, once the second level has been selected, here's how the third level will look:

    Tax bottom (1)

Add new comment