Advertising sustains the DA. Ads are hidden for members. Join today

Contributed modules documentation

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:

Usage

Case 1: Dynamic dependent field with Entity Reference view

  1. Enable both modules from the package (Dynamic dependent fields and DDF Entity Reference).
  2. 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
  3. 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

Known issues

Help improve this page

Page status: Not set

You can: