Problem/Motivation

When using Conditional Fields with Paragraphs, the conditions stop working if the parent paragraph is using the Layout Paragraphs widget.

For example:

  • A paragraph bundle contains a field that should control the visibility of another field using Conditional Fields.
  • If the parent entity is configured to use the Layout Paragraphs widget, the conditional logic does not trigger at all.
  • If the same paragraph is edited via the default Paragraphs widget, the conditional logic works as expected (fields hide/show properly).
  • If the parent entity is configured to use the Layout Paragraphs widget, the conditional logic does not trigger at all.

Steps to reproduce

  1. Enable Paragraphs, Layout Paragraphs, and Conditional Fields.
  2. Create a paragraph type with at least two fields:
    • field_toggle (boolean or select)
    • field_dependent (text, shown only when field_toggle = true).
  3. Configure Conditional Fields to show/hide field_dependent based on field_toggle.
  4. Add the paragraph to a content type.
  5. Edit content using:
  • Default Paragraphs widget → conditional fields work.
  • Layout Paragraphs widget → conditional fields do not work (the dependent field never shows/hides).

Proposed resolution

Based on investigation:

The issue seems to be that the Conditional Fields module is unable to correctly retrieve the parent paragraph entity when using the Layout Paragraphs widget.

To resolve this, a condition/check needs to be implemented for Layout Paragraphs specifically, so the parent entity can be retrieved successfully.

This approach would be similar to what was done/proposed for Layout Builder integration in another issue. https://www.drupal.org/project/conditional_fields/issues/3105263

Comments

c.moisiadis created an issue. See original summary.

chrisla’s picture

This update to Layout Paragraphs adding the ability to get the parent ID may provide a fix for this issue as well?

https://www.drupal.org/project/layout_paragraphs/issues/3352822

nicxvan’s picture

Status: Active » Postponed

We should move the content from here to the other issue and close this as duplicate.

The reason the older issue is usually preserved is there are more followers.