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.
It would be great to be able to create dependencies within Field Collections that depend on fields within the parent node of the respective field collection item, as opposed to just other fields within the field collection (current method).
Example:
In Parent Node of Field Collection you have Fields A, B, C.
In a Field Collection within that node you have Fields D, E, F.
I would like to be able to trigger the display of D in the Field Collection if A is selected.
Wash, rinse and repeat with other items.
Please do not hesitate to ask me if you have any questions regarding this feature request.
Comments
Comment #1
kaizerking CreditAttribution: kaizerking commentedIt is much needed ,
conditional fields list should have all the fields available in host entity to manage dependency. now at present this of very limited use
Is there any other alternative module to mange dependency for all the fields in host entity including the fields in Field collection fields?
Comment #2
rv0 CreditAttribution: rv0 commentedaha indeed, been looking for this feature too
it probably works like this because the field_collection is an entity on its own
Comment #3
kaizerking CreditAttribution: kaizerking commentedField collection plays "dual role", It works as a field and as well as entity. How ever a field collection filed is never or can never be a hostEntity. as per the documentation.To prove that all the fields can be listed from all the filed collections, there is working module which does this , Field Collection Views what this does is it extracts all the fields from hostEntity i.e all the fields from all the field collections of a host entity, the concept can be utilised for conditional fields purpose to list all the fields. the difference is it doesn't include the fields which are directly attached to the host entity.since conditional fields can do that part. i think it just some one should take it up to pull code from there.
What is required is the lists now we have as dependent and dependee should list all the fields , including the field collection fields and the fields within the field collection fields.
Comment #4
phenaproximaI'd like to see this too.
Comment #5
ilanben CreditAttribution: ilanben commentedI'm really supporting to implement this too
Comment #6
lunk rat CreditAttribution: lunk rat commentedI want to add that I also have a use-case where I need to make certain field collection fields dependents of fields that exist on the host entity.
Comment #7
lunk rat CreditAttribution: lunk rat commentedComment #8
bluesman2014 CreditAttribution: bluesman2014 commentedThis would be a great function. Has anyone found a way of implementing it yet?
Comment #9
bluesman2014 CreditAttribution: bluesman2014 commentedI found a frontend workaround to this problem. Doesn't solve things on the server side, but it might be enough for you too.
I was trying to make certain fields visible or invisible depending on options that had been selected within a field collection (which clearly doesn't work using dependencies at present).
In my field collection field, I updated my radio button options from A, B, C to
<span id="option-a">A</span>
,<span id=option-b">B</span>
etc. and made all the fields I wanted to toggle invisible via CSS (display: none)I then created a script using
document.getElementById("option-a") !=null
thereby making other fields on the page visible when such and such an option 'exists'Comment #10
mitch147 CreditAttribution: mitch147 commentedThis functionality is definitely needed. The ability to hide different fields within a field set would greatly improve this modules functionality.
Has anyone figured out a way around this. I currently have an entity form with a field set and inside that field set there are fields that need to be visible/hidden depending on user input in the original entity form. Conditional fields does not allow this as of yet, is there any other way around this issue?
Comment #11
zlinedavid89 CreditAttribution: zlinedavid89 commentedSign me up for this feature as well. Would be incredibly valuable.
Comment #12
adamtong CreditAttribution: adamtong commentedi also want to have this feature too!