Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It would be nice to be able to set the maximum number of levels that a user can create..
This could be put when the user selects "Allow creating new levels".
Comments
Comment #1
stBorchertYou may implement
hook_shs_add_term_access()
to deny creating new terms. Simply spoken you need to get a list of all terms of the level you'd like to deny creating childs for and use this as the base for the hook implementation.Example:
Comment #2
kitikonti CreditAttribution: kitikonti commented@stBochert is there a reason why this will not be added in the module itself? Not everyone who use this module is a developer and so they wont be able to use this code snippet. I ask because i also need this feature. I am able to make a custom module but i think it would make sence to add this to the module?
PS: I have related two other issues i have found with the same request to this issue.
Comment #3
kitikonti CreditAttribution: kitikonti commentedSo, i have tested this function but it dose not 100% do what i wanted to do. Ok i could restrict creating of new terms depending of a parent term, but if i have two levels and i want to be able to create new terms in the first and the second level, it always also shows a select box for the third level after selecting an option in the secound one. The only think that dose change is that i could disable the creation of terms for the third level, but the selectbox is still there. I know i could hide it with css but i was wondering if i could prevent the rendering of this field?