Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Views Bootstrap 5.5.4 — Minor update available for module views_bootstrap (5.5.4). Release: Rightup theme 1.0.3 — Minor update available for theme vartheme_bs5_rightup (1.0.3). Release: CommentOn 1.0.6 — Minor update available for module commenton (1.0.6). Release: ChatGPT Ads 1.0.3 — Minor update available for module chatgpt_ads (1.0.3). Release: Opensolr Search 5.1.3 — Minor update available for module opensolr_search (5.1.3). Release: ServiceM8 Webform Integration 1.2.1 — Minor update available for module servicem8_webform (1.2.1). Release: PostfixAdmin 1.0.0 — Initial release available for module postfix_admin (1.0.0)! Release: ip_analyser 1.0.3 — Minor update available for module ip_analyser (1.0.3). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.

If you need a taxonomy field to be filtered based off of another taxonomy field's value, this module is for you. It is handled via Views.

I originally used Business Rules to accomplish the filtering but Business Rules only allowed filtering of one child when we needed multiple. That is all this module does where Business Rules has a lot of other things; not just dependent fields.

This module handles multiple dependencies so if you have a field that needs to filter multiple fields in your form, this module can handle that.

It is configured through an admin form where you specify the following:

  • Node or Media Type - Which content or media type the two fields are on.
  • Control Field - The field which controls the results of the Target Field.
  • Target Field - The field which changes values based off of the Control Field.
  • View - The view which handles the filtering. This view has a contextual filter (which should be your Control Field). The view handles the filtering so however you need to filter the Target Field, you do it with the view. The output of the view needs to be an HTML list of fields where you rewrite the result as tid|Option Name.

Features

  • Easy to maintain relationships
  • Relates taxonomy terms to other taxonomy terms in different vocabularies
  • Views controls the dependencies so it's easy to order
  • Works with select2, checkboxes, drop downs, radio buttons, etc.
  • Created two hooks to allow developers added functionality:
    • one to alter the form before it's processed
    • one to do other stuff on the event that something else needs to change when a field changes (ex. populate or manipulate a text field, clear a field's value, etc)
  • Works with node and media bundle entities

Installation & Setup

  • Install and enable the module
  • Establish relationships in taxonomy terms by creating a field on the dependent
    vocabulary. Add dependencies on terms.
  • Create a view which gets a term ID from the control vocabulary (contextual
    filter). Rewrite the results so it's in this kind of format:
    tid|Name
    ex. 45|Ball

  • Go to /admin/config/content/form_filter_fields to add the relationship to your two fields.
  • Test and profit!

Related Modules

Known Issues

  • This module does not work with IEF (Inline Entity Form). Their way of creating forms is using a different object/class which is more complicated than Drupal's.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Feb 2023
Latest release
3 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core Release date
8.x-1.6 Stable May 5, 2023
8.x-1.5 Stable Feb 5, 2023