How To Implement Drupal Taxonomy with Hierarchical Select ?
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.
- 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.
- Click on Hierarchical Select Widget.
- Select radio button next to Hierarchical Select configuration according to your requirement.
- Enter lebel next to Level labels
- Finally, click "Add content" and use your field. Here's how the top level will look:
- And, once the first level has been selected, here's how the second level will look:
- And, once the second level has been selected, here's how the third level will look: