Collapse taxonomy in default node field

When creating (custom) content in Drupal, I have three dictionaries. But that makes my content creation page very difficult. I want to turn the default Vocubalary popup field and want it to expand only if the user selects.

+3
source share
2 answers

If you mean that the taxonomy field should appear as minimized by default, you can achieve this by doing hook_form_alter():

/**
 * Implementation of hook_form_alter().
 */
function yourModule_form_alter(&$form, &$form_state, $form_id) {
  // TODO: Adjust the form id according to your content type
  if ($form_id == 'yourContentType_node_form') {
    // Collapse 'Vocabularies' fieldset.
    $form['taxonomy']['#collapsed'] = TRUE;
  }
}
+3
source

The Big Autocomplete TAXonomy (BATAX) is likely to do what you want.

+1
source

Source: https://habr.com/ru/post/1750686/


All Articles