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.
Currently if the image is missing (e.g. the field value is empty on the current node) the field group will still render, but without a style attribute.
I'd like to be able to optionally prevent the field group from rending at all, if the image is missing. This would be done via a checkbox on the field group settings. The default setting would be to render the field groups even if they have missing fields (this would prevent the behaviour from breaking any existing field groups).
Comment | File | Size | Author |
---|---|---|---|
#3 | hide_field_group_if-2843852-3.patch | 2.03 KB | Leon Kessler |
#2 | hide_field_group_if-2843852-2.patch | 2.03 KB | Leon Kessler |
Comments
Comment #2
Leon Kessler CreditAttribution: Leon Kessler at Mirum Agency commentedComment #3
Leon Kessler CreditAttribution: Leon Kessler at Mirum Agency commentedThis is better, the previous patch would just prevent the field group from rendering, but not it's children. This patch will hide the field group and all it's children.
Comment #4
Bart Vanhoutte CreditAttribution: Bart Vanhoutte at Duo commentedThanks for the patch Leon, I'll check it ASAP.
Comment #6
Bart Vanhoutte CreditAttribution: Bart Vanhoutte at Duo commentedPushed to development branch, thanks for the patch.