1

I'm using drupal 7 with the simple hierarchical module.

In my case, I always have 2 levels taxonomies (parent - 1 or more child (s)). Now the shs module works well, it shows always a first dropdown list, when I choose one term, a second dropdown fade in and displays multiple child. (I've checked the option force users to always select a child on the shs parameters).

My problem, imagine some day I'll have a term (parent) without any child. shs would probably display this parent in the first list, imagine I choose this term (for the shs I can't go deeper because no childs for this term) The probleme is : my project MUST have children terms.

I can't force users to create children when creating taxonomies (a user can create a parent today and save it, and someday he'll create child terms for this term), I want to make shs displays ALWAYS the first dropdown list (parents) and ALWAYS a second dropdown (children) even if it just displays "none" and will contain the real child when a parent would be selected. And when user choose the parent that do not have cheldren (none will stay on second dropdown) At this moment, my shs is configured to display the error message "go deeper" he probably want to go "deeper" and surprise: no child, there is only 'none' and at this moment, he will go to create child..

For example :

imagine the term "A" in the attached file, has no child terms, and even if it's that case, we would have a second dropdown with "none". thank you

  • have you tried ajax dependent dropdown? it is the more flexible way than hacking the core of a module! – Shabir A. Oct 30 '15 at 18:49
  • Hello @Shabir no i don't, can you show me how to do that please ? – sushi Oct 30 '15 at 18:51
  • Okay, use two taxonomies. Child and Parent. in Child term add a term reference field names parent. use example drop down Use api.drupal.org/api/examples/ajax_example!ajax_example.module/… – Shabir A. Oct 30 '15 at 18:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.