How to show more terms in the "Parent terms" select list when adding taxonomy term? When adding terms to a taxonomy vocabulary, the "Parent terms" scrolling selector list in the "RELATIONS" section only displays 4 items. When dealing with large, complex, hierarchical taxonomies, this makes it difficult and slow to find the parent (a similar complaint and another).

I would love to be able to use something like the Simple hierarchical select or Client-side hierarchical select widget there, but assuming that's not currently possible, how can I simply display a longer list to make the selection a bit easier?

I am guessing there is a file somewhere containing a setting of "4" (unless that's a default) that I would able to increase to "20" for example. I hunted but couldn't find it.

I'd be interested in an answer, even if it would be a core hack that I would have to redo with each update.



Edit: It seems, from this link, that one solution may involve adding code such as this:

&lt;?php
function MyModuleName_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if ($form_id == 'taxonomy_form_term') {
    $form['relations']['parent']['#size'] = '20';
  }
}


But where to add it? Or perhaps in a custom module (called MyModuleName)? Perhaps in MyTheme.theme? Or perhaps in a twig file such as html--admin--structure--taxonomy--manage--MyVocabularyName--add.html.twig?
OK Nick, you need to add the 'hook' into a custom module..
so for drupal 8 if you do not have a custom module follow the documentation here 
https://www.drupal8.ovh/.../create-a-simple-module-for...
https://www.drupal8.ovh/.../create-a-simple-module-to-use...

In 'modules' folder create a custom folder 'custom' to hold your custom modules.
path should be ...modules/custom
inside this create a folder folder to hold your custom module my_custom_module ( orwhatever you want to call it )
path should be ...modules/custom/my_custom_module

inside this folder (my_custom_module) add a 'my_custom_module.info.yml' file in this file add 

name: My custom module
description: My custom module description
package: Custom

type: module
core: 8.x


run drush en my_custom_module -y
or in admin/modules enable the module

once enabled add a .module file to the my_custom_module folder, called my_custom_module.module (or whatever you have called it)

in this file you can add the hooks you want to use for your one it will be 

&lt;?php
function my_custom_module_form_alter(&amp;$form, &amp;$form_state, $form_id) {
if ($form_id == 'taxonomy_term_vocabulary_name_form') {
$form['relations']['parent']['#size'] = '15';
}
}


change the my_custom_module to whatever you have called your module
change the section of the form id == vocabulary name to the name of the vocab you have created, you may need to inspect this and find it the form id! mine matched the vocab

clear the cache, go to your vocabulary and add a new term ! fingers crossed the size of the selct box has changed 

think this covers it all, good luck