Hierarchical Select Flat List: new mode that doesn't support hierarchies, but does allow usage of the dropbox

derjochenmeyer - May 28, 2008 - 12:45
Project:Hierarchical Select
Version:5.x-3.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Wim Leers
Status:closed
Description

This has maybe been requested before, but i could not find it in the issue tracker...

The multi select option is a really cool feature that would be very handy for CCK multiselect fields. Anybody who knows how to start here?

#1

Wim Leers - May 28, 2008 - 13:08
Title:Support for CCK select fields» New mode that doesn't support hierarchies, but does allow usage of the dropbox
Assigned to:Anonymous» Wim Leers
Status:active» postponed

You have to implement the HS API for each hierarchy you want to use HS for. It cannot be used in a generic way.

What I could do, is allow for a "non-hierarchical HS mode", which just provides you with the ability to use the dropbox, and doesn't support hierarchies. Basically you only have to implement the hook_hierarchical_select_root_level() hook for that, and all other hooks should pretend that there are no child levels.

This will be a 6.x only feature, probably.

P.S.: support for the Location field is planned, and will be probably be added in July.

#2

derjochenmeyer - May 28, 2008 - 15:20

Hi Wim, thanks for your help.

I tried to get my head around this. How and where do i start? Can i just place my code in a custom module?

Do i just need:
hook_hierarchical_select_root_level()

hook_form_alter() (for changing the type to "hierarchical_select") or would i rather use hook_hierarchial_select_form_alter($form_id, &$form)

I'd be happy to write up a tutorial once I figured that out for myself.

#3

Wim Leers - May 28, 2008 - 17:30

1) Read API.txt's "hooks" section.
2) Look at the modules/views_taxonomy.module file for an example that's pretty close to what you will be doing.
3) You need to implement root_level(), but also all other, non-optional hooks, most will be super easy though.

#4

Wim Leers - July 3, 2008 - 23:20
Title:New mode that doesn't support hierarchies, but does allow usage of the dropbox» Hierarchical Select Flat List: new mode that doesn't support hierarchies, but does allow usage of the dropbox
Status:postponed» fixed

Now implemented, will be used for http://drupal.org/node/231831.

#5

Anonymous (not verified) - July 23, 2008 - 10:56
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.