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:
<?php
function MyModuleName_form_alter(&$form, &$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?