I have an issue: I want only add subterm on the second level of a category only.
I have the vocab with sports generally in the first level (football) and user can create subterm below this term (eg. futsal, indoor soccer) but I do not want a subterm before futsal. I want allow only 2 level hierarchy - main terms and subterms .
With the original SHS behavior If I enable the create new term option then the user can add new term to the third level too. If I not allow this option then he can not able to add new subterm to the football term.
I developed a solution: you can allow the new term creation on the special levels. There is the shot of the field settings form:
What do you think would my solution be an usable feature?
Comment | File | Size | Author |
---|---|---|---|
#2 | shs-add_new_term_setup_proposal-2071101-2.patch | 7.56 KB | decibel.places |
#2 | third_level_none.png | 13.59 KB | decibel.places |
#1 | add_new_term_setup_proposal-2071101-1.patch | 7.53 KB | Denes.Szabo |
shs-create-new-term.png | 22.49 KB | Denes.Szabo |
Comments
Comment #1
Denes.Szabo CreditAttribution: Denes.Szabo commentedI attached my patch.
Comment #2
decibel.places CreditAttribution: decibel.places commentedPatch in #1 failed one chunk:
rerolled and applied to 7.x-1.x from git
One problem, though is that there is a nagging third level eunich that cannot be set but displays. My settings to allow adding a term on the second level, and stop there. First row select shown expanded with only option "none"
[edit]
wellz I hid it with CSS
.shs-select-level-3 {display:none!important}
Comment #3
pinkonomy CreditAttribution: pinkonomy commented@decibel.places: Hi ,I saw the image you have attached,have you manages to show all 3 levels from the beginning?If yes,how did you do that?
thanks
Comment #4
decibel.places CreditAttribution: decibel.places commented@pinkonomy do you mean how did I capture the -None- with the orange bg as the dropdown of the 3rd level?
I think I was using the Linux Shutter app. You should also be able to capture the screen on a PC with the PrtScn button. Or on Mac Apple key ⌘ + Shift + 3
Then I edited the full screen capture to the selection.
Comment #5
stBorchertThe patch is not needed since there is
hook_shs_add_term_access()
you may implement in a custom module to achieve this feature.Example:
Comment #6
stBorchertComment #7
kitikonti CreditAttribution: kitikonti commentedComment #8
ShaneOnABike CreditAttribution: ShaneOnABike commentedI agree that adding this into the system would be super awesome but the API works great once you get it all configured properly.
ALTHOUGH I would say that the last select should really be hidden if there are no results.