Is there some way how to disable one vocabulary from select box of categories under advanced search?

I want to use free tagging but when site will have 8000 tags it is not practical to load them all to select box under advanced search.

CommentFileSizeAuthor
#2 node_8.module88.65 KBanantagati
#1 node_7.module88.65 KBanantagati

Comments

anantagati’s picture

Title: Free tags in select box under advanced search. » Add checkbox for enable/disable Freetags Vocabularies in advanced search
Version: x.y.z » 4.7.3
Component: search.module » node.module
Assigned: Unassigned » anantagati
Priority: Critical » Normal
StatusFileSize
new88.65 KB

I make new feature for ability to choose if you want to show freetags vocabularies in advanced search in category filter.

insert this code to node.php (v 1.641.2.12 2006/07/26) on line 612:

      // Vocabulary settings:
      $form['vocabulary_settings'] = array('#type' => 'fieldset', '#title' => t('Vocabulary settings'));
      $form['vocabulary_settings']['show_freetags_vocabulary'] = array('#type' => 'checkbox', '#title' => t('Show Freetags Vocabularies'), '#default_value' => variable_get('show_freetags_vocabulary', true), '#description' => t('Whether to show Freetags vocabularies in advanced search in category filter.'));

and after change this line under function node_form_alter($form_id, &$form):

    if ($taxonomy = module_invoke('taxonomy', 'form_all', 1)) {

to this:

if ($taxonomy = module_invoke('taxonomy', 'form_all', variable_get('show_freetags_vocabulary', true))) {

After change there is one more checkbox under settings/search which you can check/uncheck to choose if you want to show freetags vocabularies on categery filter.

anantagati’s picture

StatusFileSize
new88.65 KB

I make new feature for ability to choose if you want to show freetags vocabularies in advanced search in category filter.

insert this code to node.php (v 1.641.2.12 2006/07/26) on line 612:

      // Vocabulary settings:
      $form['vocabulary_settings'] = array('#type' => 'fieldset', '#title' => t('Vocabulary settings'));
      $form['vocabulary_settings']['show_freetags_vocabulary'] = array('#type' => 'checkbox', '#title' => t('Show Freetags Vocabularies'), '#default_value' => variable_get('show_freetags_vocabulary', true), '#description' => t('Whether to show Freetags vocabularies in advanced search in category filter.'));

and after change this line under function node_form_alter($form_id, &$form):

    if ($taxonomy = module_invoke('taxonomy', 'form_all', 1)) {

to this:


if ($taxonomy = module_invoke('taxonomy', 'form_all', variable_get('show_freetags_vocabulary', true))) {

After change there is one more checkbox under settings/search which you can check/uncheck to choose if you want to show freetags vocabularies on categery filter.

anantagati’s picture

Status: Active » Needs review
killes@www.drop.org’s picture

Version: 4.7.3 » x.y.z

features go into CVS version

Jaza’s picture

Status: Needs review » Needs work

A few bits of feedback:

  1. You should investigate whether this can be done without changing node.module, using hook_form_alter() on the advanced search form. It is quite possible that this is the case. If so, you can write a contrib module to implement this functionality, and core doesn't need to change - users who need the feature can download the contrib module.
  2. Perhaps this option would work better as a per-vocabulary option, rather than as a global option? If so, then it should apply to all vocabularies. Why does it have to apply only to free-tagging vocabularies? Users might have non-free-tagging vocabularies that they don't want showing up in the 'advanced search' form.
  3. Please submit patch files, not entire module files (how to create patches). Patches are much easier to review, and only patches will get committed.
anantagati’s picture

Version: x.y.z » 5.x-dev
Component: node.module » search.module
Assigned: anantagati » Unassigned
Status: Needs work » Active
marcingy’s picture

Version: 5.x-dev » 8.x-dev

Bumping version

jhodgdon’s picture

This issue and #42466: Optional Exclusion of Taxonomy Vocabulary from Advanced Search are duplicates of each other. I'm closing that other one and leaving this one open.

jhodgdon’s picture

Title: Add checkbox for enable/disable Freetags Vocabularies in advanced search » Add ability to enable/disable individual vocabularies in advanced search
jhodgdon’s picture

Related request (I don't think it's a duplicate, but it is related):
#42092: Provide a autocomplete selection box on advanced search

jhodgdon’s picture

Status: Active » Closed (fixed)

Actually, taxonomy searching has completely been eliminated in Drupal 7, so this issue has gone away.

See #144043: Allow searching by fields and taxonomy

jschrab’s picture

For those of us that are dependent on the D6 "filter by taxonomy term/category" feature, what is the current Plan B when using D7? The Content Management Filter module doesn't have a D7 version yet (or hasn't since I last checked).