I have a taxonomy, say 'Unit'. Besides the name of the Unit, there is a field called 'SubUnit'. All users in my Drupal site have assigned a Unit.

On the node add forms (and on the Views, for filtering), I would like to get only the 'SubUnits' corresponding to the assigned Unit per user. That is, only visualize on the dropdown list 'his' units.

I have seen around this answer, but it's from 2011, maybe there is an updated and easier way to do it? there is no way to create a filter based on the results of a view? (i can pass Únit as contextual filter and get its subunits)


Try the Hierarchical Select module. This module integrates with Taxonomy.

This module defines the "hierarchical_select" form element, which is a greatly enhanced way for letting the user select items in a hierarchy.

Hierarchical Select has the ability to save the entire lineage of a selection or only the "deepest" selection. You can configure it to force the user to make a selection as deep as possible in the tree, or allow the user to select an item anywhere in the tree. Levels can be labeled, you can configure limit the number of items that can be selected, configure a title for the dropbox, choose a site-wide animation delay, and so on. You can even create new items and levels through Hierarchical Select!

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.