It is straightforward to create a dependency on an explicit taxonomy term, but let's say I have a nested taxonomy like:
Term Parent
- Term Child 1
- Term Child 2
- Term Child 3
...
- Term Child 15
I would like to show a field if any of the terms within the term parent are selected. What would be the easiest way to do that in this module?
I can use the term id values in a list, but would be nice to be able to just base the value off the parent, so that terms that are created under in in the future can continue to display the dependent fields.
Issue fork conditional_fields-2550167
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
t0xicCode CreditAttribution: t0xicCode at OpenConcept Consulting Inc. commentedThis patch seems to make it work with taxonomy referenced through an entity_reference field. Adding support for the taxonomy_reference field should be fairly straight forward.
Comment #3
t0xicCode CreditAttribution: t0xicCode at OpenConcept Consulting Inc. commentedUpdated the patch to better deal with grandchildren and descendants further down. Also updated the UI to reflect that we now deal with descendants, not just children.
Comment #4
t0xicCode CreditAttribution: t0xicCode at OpenConcept Consulting Inc. commentedComment #5
delacosta456 CreditAttribution: delacosta456 commentedhi @Sansui
the patch #3 doesn't apply corrctly
Comment #6
delacosta456 CreditAttribution: delacosta456 commentedhi @Sansui
I am sorry never mind... it was a file/folder permission blocking the patch not apply
Comment #7
Ghost of Drupal PastThis is an issue with Drupal 9 as well as far as I can tell.
Comment #8
sarathkmComment #9
sarathkmComment #11
sarathkmThis feature has been tested and developed while using cshs module. Need to enable a checkbox in conditional field configuration as needed.
Comment #12
sarathkmComment #13
Liam MorlandDrupal 7 version of this.
Comment #14
Liam MorlandI tried the patch in #11. It did not work for me. Based on that I created this version that works for me.
I have updated the merge request with these changes.
Comment #15
Liam MorlandComment #16
Liam MorlandThis patch moves the code to ConditionalFieldsFormHelper, allowing it to work on all handler types. Previously, it only worked on the default handler. I have updated the merge request with these changes.
I have also rebased the merge request.
This patch applies to 4.0.0-alpha5.
Comment #17
Liam MorlandThis patch is from the rebased merge request and applies to 4.x.
Comment #18
dqdLast patch looks good. +1 Better than before because it does not remove/replace anything existing in code and sits on the right spot now. Thanks for all the efforts and work in here. +1
We need user tests on latest dev and foremost we need test coverage for this newly implemented feature. Gitlab testing CI for Conditional fields (issue) is on the way, but not ready yet.
And, I would love to see confirmation of multiple users testing it in the wild, and that it does not break other features of this project.