Search code examples
drupal-7admindrupal-taxonomy

Drupal 7 Taxonomy Multiselect box size


I have couple of taxonomies that have few hundred terms in. A content type has multiple of these taxonomy multiselect boxes.

Problem is, that select box size is about 5 (so it shows only 5 at the time). How can i increase the size? Because now treelike use is impossible, because you won't see parent after you've scrolled a bit back.

The problem is in the admin / editor view, and are not related to end-user.


Solution

  • If it's really about the height of that select box, why don't you add it via CSS?

    #your-form-id .form-select[multiple] {
      height: 300px;
    }
    

    Alternatively, implement hook_form_alter in your module:

    <?php
      function YOURMODULE_form_alter(&$form, &$form_state, $form_id) {
        $form['YOURFIELD']['#size'] = 30;
      }
    ?>