An option to auto-select parent entities would be helpful in certain use cases.
For example, if I had some kind of a nature site and want to add a page about the grizzly bear (Ursus arctos), I want to select the (level 6) Genus (Ursus). When doing so, I would like to have the parent terms also be selected automatically, that is (level 5: Family) Ursidae, (level 4: Order) Carnivore, (level 3: Class) Mammalia, (level 2: Phylum) Chordata, and (level 1: Kingdom) Animalia.
Animalia
- Chordata
- Mammalia
- Carnivora
- Ursidae
- Ursus
Vice versa, another option to unselect all children when a parent term is unselected would be helpful as well.
Comments
Comment #2
rose_at_la commentedDoesn't fully solve your problem (only toggles children based on the parent) hence why I created a separate issue but might be helpful for your needs: https://www.drupal.org/project/entity_reference_tree/issues/3106864
Comment #3
nick hope commentedI am developing a site with large hierarchical taxonomies of species and locations. Instead of selecting all parents in the hierarchy, I am only selecting the taxonomy term at the deepest level, and then using other Drupal tools to display the rest of the tree where needed.
Specifically, the Hierarchical Term Formatter module allows me to display the selected term and all its parents on a species' page, or on a media item that is tagged with that species, for example in a breadcrumb style. And the Views: Media taxonomy filter allows me to display media related a taxon and all its descendents without having to specifically tag each level in the whole hierarchy. And the Hierarchical Taxonomy Menu is useful too.
Obviously this doesn't directly address this issue. Auto-selection of parent entities would be a useful option. I'm just highlighting a possible alternative approach to building this kind of site.