A couple of remarks:
- Since CCK itself does not have a strict hierarchical format to represent an item *uniquely* in such a hierarchy, we generate one on-the-fly.
- I've put the implementation in a separate file, content_hierarchical_select.inc, because it doesn't really belong anywhere else
- This file is included in hook_menu()'s uncached path. You can't just include it when you need it, because I also need to include it on JSON callbacks. If you don't like this, I could make HS automatically look for a "<modulename>/<modulename>_hierarchical_select.inc" file and include it on
the fly.
- I'm still working with merlin to get the CSS/JS loaded up front (through a new, yet to be written hook in Panels 2), Drupal.settings will also be handled through Panels, in a similar manner as in Views 2.
- Because of the previous remark, not everything that's necessary for HS, is loaded. HS degrades gracefully (albeit less gracefully without the CSS), so it stays functional. However, the "Add pane" button stops working, for an unknown reason (haven't had the time to track down the cause).
- You *can* use it properly in the demo module I attached.
So, summarized:
- the implementation of the HS API works fine.
- for actually using this with Panels, you may want to wait (due to the modal).
- you *can* use HS as a "progressive enhancement" elsewhere in the CCK UI, as long as you're not doing it in a pop-up. (I haven't looked where this could be useful, just saying that you can.)
| Comment | File | Size | Author |
|---|---|---|---|
| hsdemo.zip | 1.75 KB | wim leers | |
| cck_hierarchical_select.patch | 8.41 KB | wim leers |
Comments
Comment #1
wim leersActually, the patch itself doesn't need work. It's Panels that does. So changing to CNR.
Forgot to mention: you must test this with HEAD of Hierarchical Select. It will work with version 2.2 as well, but HEAD no longer depends on jquery_interface, only on jquery_update, so that's one less dependency.
Comment #2
Ulti commentedHi Wim, thanks for your work on this! I need to make CCK fields manageable in Panels2 for the users of a new intranet site I'm making. With the current solution on the recent CCK issue thread, it’s a bit of a nightmare to browse through all the fields, I can't really let any users have a go with panels, until it is simplified in a hierarchy. So I think this is going to be an important addition. Can you let me know about any developments specific to Panels2? Many thanks for your efforts.
Comment #3
wim leersI will post Panels 2 updates here as I receive them, yes :)
I talked about it last week with sdboyer and merlinofchaos and Panels 2 *will* make the necessary changes to support dynamic loading of CSS/JS/Drupal.settings to make HS work inside the Panels 2 JS modal. merlin knows how to do it, all he needs is time.
Comment #4
karens commentedI assume this is for D5 not D6. There is no Panels 2 for D6 and there is no content_panels.inc in the D6 version of CCK.
Comment #5
wim leersOops, of course :)
Comment #6
karens commentedThis kind of died. Is it still valid?
Comment #7
wim leersIf CCK's API's didn't change, it should still work.
Comment #8
rjbalest commentedIs this still the best module to get hierarchical select in CCK fields or has something else superseded it?
I'm about to check it out. I'm hoping that I can seed the options with existing flat taxonomies. So I can build strings from taxonomy terms in differenent vocabs. Like: aterm2-bterm3-cterm5
So many modules ...
Comment #9
Defender-1 commentedCCK's API changed a little bit. Will there be any updated patch?
Comment #10
markus_petrux commentedCCK3 is related to the multigroup. Please, see #494100: State of the multigroup module.
Also, I'm marking this as won't fix. AFAICT, it won't happen for CCK for Drupal 6. And I think it's been implemented in contrib.
http://drupal.org/project/hierarchical_select