[Drupal] How to get hierarchical select list inside a View in Drupal 7?

| | 1 min read

In Drupal, Heirarchical select list simply means the select list has child and parent terms in Select lists. Getting a search field inside a Drupal view is quite easy but how can we get a hierarchical select list inside the 'Filter criteria'? Read on to know how to get hierarchical select list inside a View in Drupal 7

To make this work, we need to use the Simple Hierarchial Select module. Our aim is to get the Heirarchical Select List of Country and Town in a view so that we can filter the contents according to the Country.

Step 1 : As usual enable the module in admin > modules.

Step 2 : Get into the view where we need to get the heirarchical select in filters.

Here is the place where we have to run across.

Step 3 : Add field in the 'Filter:Criteria' say 'Content: Has taxonomy terms (with depth; Simple hierarchical select)'.

Step 4 : Select the vocabulary we required to have the select list , and select the type as 'Simple Heirarchical Select'.

Step 5 : Check the option 'Expose this filter to visitors, to allow them to change it'.

Here we are !! Save the view and now you can see the filter with heirarchical select list.

References:

1. http://drupal.org/project/shs