Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I've seen a few requests to make fields within a collection conditional, but I have a need for the entire field collection to be triggered by a boolean.
Many thanks.
Comments
Comment #1
bryancasler CreditAttribution: bryancasler commentedbump
Comment #2
jamescl CreditAttribution: jamescl commentedYou can made a field collection field conditional on a boolean field in the Content/TaxTerm etc in the same way you would do this for a non field collection field.
Comment #3
dagomar CreditAttribution: dagomar commentedHave you actually tried this? I just did, and it doesnt work.
This is not a duplicate. It just doesnt work. Steps:
Create a field collection.
Add it to a node
Add a Float
Add a condition based on that float
And see that it doesnt work.
Comment #4
dagomar CreditAttribution: dagomar commentedSorry reopening, see previous comment
Comment #5
zarexogre CreditAttribution: zarexogre commentedI have the same problem, simple setup a field which is a field collection triggered by a boolean. Added another simple text field as well to test and the text field works but the field collection is always visible?
Comment #6
MO-2 CreditAttribution: MO-2 commented~Same issue here.
Use Case
RESULT: This use case hides 1 and 2 appropriately until their assigned terms are selected in the taxonomy term selector, but won't hide B by default.
-----------
UPDATE
Here is the fix: https://drupal.org/node/1648128#comment-7857101
Comment #7
kenorb CreditAttribution: kenorb commented#1648128: field collections within other field collections do not function when set as dependents