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.
Hi,
Could you had this feature ? Hide Group Label... when all fields empty
Thank you
(using last dev version)
Comments
Comment #1
yched CreditAttribution: yched commentedTrue, this is annoying.
Whether a field is 'empty' (has no output) is decided at render time.
Fieldset-based display of fieldgroups currently use core's 'fieldset' FAPI element, whose theme function doesn't have this feature.
Fixed by using our own 'fieldgroup_fieldset' elements, that don't display anything is content is empty.
The change requires the theme registry to be rebuild, obviously.
Comment #2
chipway CreditAttribution: chipway commentedHi,
Thank you for your answer.
So, if I undestand, I have to do a specifc template file in order to hide group when empty ?
Comment #3
yched CreditAttribution: yched commentedNope, just grab CCK's RC release on http://drupal.org/project/cck, and empty your site's caches
(using devel.module's 'empty cache' if you have devel, or the 'clear cached data' button on admin/settings/performance)
Comment #4
chipway CreditAttribution: chipway commentedOk,
Thank you.
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #6
terry22 CreditAttribution: terry22 commentedHi, I'm trying to acheive the same thing: hide fieldgroup display if inside field is empty.
I got the last version of cck, but the fieldgroup still appears even if there is no content in it.
Is there a way to do this?
thank you for your help
Comment #7
Aurochs CreditAttribution: Aurochs commentedsame issue here
6.x-2.6
did you forget to fix it in the new release?
Comment #8
mmccollow CreditAttribution: mmccollow commentedI'm also using 6.x-2.6 and field groups that contain only empty fields are still being displayed. The 5.x fieldgroup.module had this code in fieldgroup_nodeapi():
I don't really understand the 6.x module yet, but it's changed significantly, especially fieldgroup_nodeapi(). Should groups with nothing but empty fields still be hidden, or was that removed from 6.x-2.6?
Comment #9
WorldFallz CreditAttribution: WorldFallz commenteddefinitely a regression between the 5.x and 6.x versions-- i haven't figured out the best way to fix it yet, but I'll post a patch if I do.
Comment #10
sf_wind CreditAttribution: sf_wind commentedsubscribe
Comment #11
SeanA CreditAttribution: SeanA commentedI can't reproduce this problem. If all fields are empty, the fieldgroup fieldset is not displayed. I had an old dev site that hadn't been touched in a while, so I tried it with CCK 2.2, 2.6, and 2.9. All with the same result: the empty fieldgroup was never displayed.
Could there be some other fieldset theming function from some other module or theme that is causing problems for others?
Possibly related:
#963180: Fieldgroup Templates
#599772: slate_fieldset in template.php causes problems with cck collapsable fieldsets
Comment #12
Vote_Sizing_Steve CreditAttribution: Vote_Sizing_Steve commentedHave you tried with a link field? Perhaps it's the url/title combination which causes this outputting of empty fieldsets in my site.
Comment #13
timd.mackey CreditAttribution: timd.mackey commentedI was running into this problem, and it turned out that my content-field .tpl files were the cause of it. Several of my field .tpl's had extra line-returns in them before and/or after the
<?php if (!$field_empty) : ?>
code block. I was able to solve it by going through all of my content-field .tpl's and removing any extra line-returns so that there was a maximum of one line return between the php code blocks.ie- changing this:
to this:
fixed my problem.
Comment #14
giorgio79 CreditAttribution: giorgio79 commentedI am still getting this.
I gave admin permissions to some fields, put them in a group labelled "Admin" and the empty Admin group shows up for those users who cannot see the fields in there.
Comment #15
giorgio79 CreditAttribution: giorgio79 commented#1319942: Conditionally show/hide field groups that have no visible fields (due to access control)
Comment #16
WorldFallz CreditAttribution: WorldFallz commentedfield_group for d7 is a completely different module and as far as I know, this issue still exists for the d6 version of fieldgroup that belongs to cck-- there's no legit reason to move it. Rather you should create a new issue in the new module's issue queue.