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
- Enable Paragraphs, Layout Paragraphs, and Conditional Fields.
- Create a paragraph type with at least two fields:
- field_toggle (boolean or select)
- field_dependent (text, shown only when field_toggle = true).
- Configure Conditional Fields to show/hide field_dependent based on field_toggle.
- Add the paragraph to a content type.
- 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
Comment #2
chrisla commentedThis 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
Comment #3
nicxvan commentedWe 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.