Dynamic dependent fields
Last updated on
30 April 2025
Overview
The Dynamic dependent fields module makes field value or options depend on other field values when editing entity.
The project consists of two modules:
- Dynamic dependent fields - serves as a core API and adds support of dynamic dependency for options.
- DDF Entity Reference - a submodule of Dynamic dependent fields module that adds support of dynamic dependency for entity reference fields.
Dependencies
Dynamic dependent fields:
DDF Entity Reference:
- Dynamic dependent fields
- Entity reference
- Views
Usage
Case 1: Dynamic dependent field with Entity Reference view
- Enable both modules from the package (Dynamic dependent fields and DDF Entity Reference).
- Create a view with:
- An Entity Reference display
- Input/Contextual filter: Your argument-field type, e.g. if you pick from a list of nodes - the content id
- Output: A list of items you would like to reference to e.g. taxonomy terms
- Create two fields
- Your argument field of whatever type you expect for your entity-reference (e.g. nodes) view (Cardinality of this field must be 1 as of now - feature request is pending)
- For the dependent field create an field of the type Entity Reference; for the entity selection choose Views: Filter with an entity reference view with dynamic arguments as a selector (Note: This is the view that will take your contextual argument, if it doesn't appear on the list the target type doesn't match)
- Below this field you will see a list of Dynamic arguments; these are possible argument fields. If your field is not listed check the cardinality and type of this argument field.
Limitations
- The module currently only supports using the select widget for your fields. There are issues open to improve this:
#2185269: Support Autocompletion Fields
#2192557: Support Checkboxes/Radiobuttons for the dependent field
Known issues
- The module doesn't completely support export via Features module. You may find a temporary solution in the issue #2201097: Adding export Features for DDF
Help improve this page
Page status: Not set
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion