Hi Wim!

I need to expand select field for parent and child terms

Here is an example what I need http://wimleers.com/demo/hierarchical-select/menu

I read README and found this:

Setting a fixed size

When you don't want users to be able to resize a hierarchical select
themselves, you can set a fixed size in advance yourself
Setting #size to >1 does *not* generate #multiple = TRUE selects! And the
opposite is also true. #multiple sets the "multiple" HTML attribute. This
enables the user to select multiple options of a select. #size just controls
the "size" HTML attribute. This increases the vertical size of selects,
thereby showing more options.

Can you please clarify where is "#size" variable or how to create the variable? Hard to understand because I'm not a coder.

Thanks!

Comments

wim leers’s picture

Status: Active » Fixed

Use hook_form_alter() and set the #size attribute of the HS form item. I can't put *every* detail in the config UI, because it would become too cluttered. Very, very few users need this. Which is why you have to do this manually using FAPI. Sorry :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

iori57’s picture

I have no idea how to use FAPI nor hook_form_alter() ... how to achieve this?

buckley’s picture

I also could use this (in the gui :) )

nodecode’s picture

Category: support » feature
Status: Closed (fixed) » Needs review

I LOVE this module (really great work) but I third that emotion. I could TOTALLY use a select field size option in the UI and i bet there's more users than you think who need this too.

Not being able to see all of the terms on the list makes the selection process much harder to follow than the example you provide on your demo page. After i've resized the window like i want, EVERY time i click on an item or click the ADD button...*BAM* it snaps back to one line and i visually loose my place. I constantly have to resize the window making the resize feature frustrating rather than useful.

I also have no experience with templates or Forms API (though im reading up on it) so i can't figure out how I'm supposed to get this to work. As i said before i LOVE this module. I don't know, if you can't find time to put this in the UI, can you at least expand on the explanation quoted in the first post of this thread? maybe just a quick php example and we can figure out the rest.

wim leers’s picture

Component: Code - Content Taxonomy » Code
robby.smith’s picture

subscribing

wim leers’s picture

Title: How to increase the vertical size of select fields? » Vertical size of HS not maintained
Assigned: volocuga » wim leers
Category: feature » bug
Status: Needs review » Active

Oh, it should not snap back to one line! That's definitely a bug.

I.e. the somewhat old 5.x-3.x-dev build that's running on my website does not have this bug: http://wimleers.com/demo/hierarchical-select/taxonomy.

triblondon’s picture

I also see this issue in 6.x production and dev releases.

wim leers’s picture

Status: Active » Fixed

Okay, I spent some time tracking down the cause of this bug and found it! :)

http://drupal.org/cvs?commit=412202

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.