Simple hierarchical select is used to display Taxonomy as a select field in my existing content type. So I'm trying to alter the value of it. Even tried using hook_form_alter but didn't work. So is there any way or hook using which I can alter the value of the select list?

  • Welcome to Drupal Answers :) Yes, that hook would be hook_form_alter. Maybe you can paste the code that didn't work so we may have a look at it. Maybe you have to ensure your hook_form_alter implementation runs last (after shs) via hook_module_implements_alter. Hard to tell with that little info.
    – leymannx
    Commented Jul 16, 2019 at 10:20

1 Answer 1


Finally, I was able to resolve it by using the module handler "shs_term_data_response". Like below

function YourModuleName_shs_term_data_response_alter(&$content, $context) {
  $termList = json_decode($content);
  $filteredList = array();
  /..your logic to modify $termList and push it to new array.../
  $content = json_encode($filteredList);

Hope it may help someone :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.