-
Notifications
You must be signed in to change notification settings - Fork 5
Dependee image fields
rtola-wpc edited this page Jun 8, 2024
·
1 revision
If the dependee field (the one that controls the dependency) is an image field, the configuration of the dependency will require a workaround configuration that the module caters for. This will permit, for example, a specified checkbox to remain hidden until a specified image field has been assigned at least one image.
- First specify the conditional (dependent) field and the dependee image field.
- Accept the default description that the conditional field is "visible" when the dependee "has value...".
- Add the dependency and on the Edit dependency page verify that:
- The Condition is set to “Value”
- The Values input mode is set to “None of these value (NOT). . .”
- The Set of values is set to 0 (zero)
- The administrator may wish to edit other options on this Edit dependency page
- Open the Advanced edit context settings fieldset and enter the following for the Custom jQuery selector for dependee:
input[name='xxx[und][0][fid]']
where ‘xxx’ is the machine name of the dependee image field. An example might be:
input[name='field_headshot_image[und][0][fid]']
- Save the settings
This should function equally well for image fields whose global settings are limited or unlimited (enabling the condition to be met with single or multiple images).
Original Source: from Drupal.org. (CC BY-SA 2.0)