Closed (fixed)
Project:
Custom Field
Version:
3.0.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 Dec 2024 at 19:42 UTC
Updated:
29 Dec 2024 at 04:02 UTC
Jump to comment: Most recent
Comments
Comment #2
apmsooner commentedThere's also this one: https://www.drupal.org/project/cshs. Need to research the best option to consider.
Comment #3
giuse69 commentedYes, but CSHS does not fit for large taxonomies since it loads all the vocabulary terms and send them to the browser, the selection does not involve ajax loading while navigating the hierarchy.
Comment #4
apmsooner commentedI'm not going to integrate with SHS module. I don't particularly like the limitations with a single bundle requirement and I think theres a little too much going on with the approach not to mention the number of unresolved issues is concerning to me. I think I can create a much simpler alternative that serves the same basic need. Stay tuned.
Comment #5
giuse69 commentedok
Comment #7
apmsooner commentedThis is first draft if you want to test out the patch. There's a few hardcoded styles just to get something visually appealing that I'll refactor but functionally... I think it's working really well. In the field settings, you'll see the new "Hierarchical select widget" as an option. Just use the default reference method for now as I haven't looked at the views option. There will be a couple extra settings at the bottom of the form:
- Force deepest level
- Show level labels
I think the descriptions are self explanatory. Try it out and let me know how it works for you. It should support multi-lingual and work fine in paragraphs as well.
Comment #8
giuse69 commentedYou're great! It works with a couple of issues:
- language translation of taxonomy terms with Hierarchical formatter seems not to work here (always taxo term in default language is shown) but I think it's a problem of the formatter and not of this thread.
- when used with flexbox formatter (not stacked), the series of selection boxes have a white space below the label that is not present in other subfield (like a select list) so the selection boxes are not aligned.
cheers
Giuse
Comment #10
apmsooner commentedThe translations are working just fine in the widget as well as the formatter in my testing. The widget now supports views to control the 1st level of hierarchy although in most cases, the default formatter should be sufficient as we're only fetching the terms for each level to help with performance.
Comment #11
apmsooner commented