Taxonomy term configuration groups
No security coverage
This module allows you to create fieldable configuration groups for taxonomy terms, enabling you to manage shared settings for multiple terms at once. You can enable grouping per vocabulary, visually assign terms to groups using an icicle interface, and programmatically access group configurations for custom use cases.
Features
-
Fieldable configuration groups for terms
- Provides a content entity
taxonomy_groupwith a per‑vocabulary bundletaxonomy_group_typeso you can attach any fields (booleans, text, entity references, etc.) to express shared settings for many terms at once.
- Provides a content entity
-
Per‑vocabulary enable/disable
- Toggle grouping on each vocabulary from its edit form. Data is preserved if you disable; it’s removed if you delete the vocabulary.
-
Visual grouping interface
- A “Terms Icicle” interface (built with D3) lets you browse a vocabulary’s hierarchy and assign terms to groups via drag/transfer between icicles.
-
Safe lifecycle and housekeeping
- Automatically creates the bundle for each enabled vocabulary, adds an operations link to “Configure term grouping,” warns on deletion, and cleans up groups and bundles when a vocabulary is deleted.
-
Programmatic access
- A lookup service
taxonomy_term_config_groups.group_lookupreturns the group for a term or all groups for a vocabulary, so your custom code can read group fields and apply behavior everywhere that term is used.
- A lookup service
Use cases:
- Search and navigation: Store “show in filter,” “boost weight,” or “navigation visibility” once per group and apply to many terms.
- Content and marketing: Associate a group landing page, banner, or copy with sets of terms.
- Commerce/fulfillment: Map term groups to shipping classes, carriers, pricing rules, or promotions.
- Governance: Keep configuration DRY, auditable, and easy to maintain instead of repeating per‑term values.
Post-Installation
- Enable the module.
- Grant permission
administer taxonomy term config groupsto appropriate roles. -
Enable grouping per vocabulary:
- Go to Structure → Taxonomy → Edit a vocabulary.
- Check “Enable term config groups for this vocabulary” and save.
-
Configure groups and assign terms:
- Use the new “Configure term grouping” operation for that vocabulary, or visit
/admin/structure/taxonomy/manage/{vid}/grouping. - Create groups, label them, and assign terms via the icicle UI. Save to create/update
taxonomy_groupentities.
- Use the new “Configure term grouping” operation for that vocabulary, or visit
-
Add fields to groups (optional, recommended):
- Go to
/admin/structure/taxonomy-groups/typesand use “Manage fields” for the bundle created for your vocabulary (ID pattern:vocab_{vid}). Add fields like “Boost weight,” “Landing page,” etc.
- Go to
-
Use in custom code (optional):
- Fetch a term’s group via
taxonomy_term_config_groups.group_lookupand read the fields on that group to drive your site’s behavior.
- Fetch a term’s group via
Additional Requirements
- Drupal core modules:
taxonomy,field(declared dependencies). -
JavaScript library:
- D3 v7 is loaded from
vendor/npm-asset/d3viataxonomy_term_config_groups.libraries.yml(bundled through Composer; no external CDN needed).
- D3 v7 is loaded from
Recommended modules/libraries
- Field UI: To manage fields on
taxonomy_groupbundles via the UI. - JSON:API or GraphQL: To expose group configuration to decoupled front-ends.
- Views: To list and administer groups or build admin reports.
Similar projects
- “Add fields to taxonomy terms” (Core): Lets you put fields on each term individually. This module differs by introducing fieldable groups of terms so you configure once and reuse across many terms.
- “Taxonomy Manager” bulk term tools: Focus on creating and editing terms efficiently. This module focuses on grouping terms into reusable configuration entities with their own fields.
- “Term Reference Tree” navigation widgets: Improve term selection UX for content authors. This module provides a site‑builder UI for defining configuration groups, not an authoring widget.
Community Documentation
- Developer README with architecture, routes, hooks, and examples: included in the project
README.md.
Technical Notes
-
Routes:
- List bundles:
/admin/structure/taxonomy-groups/types - Grouping UI:
/admin/structure/taxonomy/manage/{taxonomy_vocabulary}/grouping
- List bundles:
-
Permissions:
administer taxonomy term config groups
-
Data model:
taxonomy_group(content entity) with base fieldfield_termsreferencing the grouped term IDs.taxonomy_group_type(config entity) per vocabulary, IDvocab_{vid}.