It would be great if there was an option for or if taxonomy hide could automatically unset the vocabulary from the Advanced Search Form. The option would be better since there could be a situation where you don't want the vocabulary on the node view but would like it in the search form. I've used this code to remove them as I've needed to.
function MODULENAME_form_alter(&$form, $form_state, $form_id){
if ('search_form' == $form_id) {
unset($form['advanced']['category']['#options']['Company Relationship']);
unset($form['advanced']['category']['#options']['Visibility']);
}
return $form;
}
Is there a way to incorporate this? Does it make sense to do so?
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | hide_advanced_search-522562-7.patch | 2.18 KB | grasmash |
Comments
Comment #1
tars16 commentedJust realized there was another issue for this. Sorry.
Comment #2
calbasi1) Where is the other issue? (ok, I've seen it: http://drupal.org/node/204280#comment-2309406)
2) Your code could be added as a patch, isn't it?
Comment #3
GTLv97.6 commentedThis is still a dirty way of doing it but at least it's still more general.
Included at the end of:
taxonomy_hide.moduleComment #4
Clément commentedGTLv97.6 thank you very much, your solution works!
I do not understand why it is necessary to place the module taxonomy_hide but the main thing is that it works ;)
Comment #5
ktf commentedThis is great, thank you. I don't understand why this isn't the default behavior.
Comment #6
summit commentedSubscribing, greetings, Martijn
Comment #7
grasmash commentedI've created a patch that adds a new 'Hide on Advanced Search' checkbox to the taxonomy_hide admin settings page. Checking this will implement the above function.