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.
This line in drupal.css is used to hide legends within vertical tabs:
.vertical-tabs .vertical-tabs-panes .vertical-tabs-pane legend { display:none; }
Unfortunately it also removes legends for fieldsets nested within vertical tabs panes.
Comment | File | Size | Author |
---|---|---|---|
#6 | 0001-Issue-1212314-by-ericduran-Fixed-Fieldgroup-legend-t.patch | 771 bytes | ericduran |
#6 | before.png | 27.51 KB | ericduran |
#6 | after.png | 30.26 KB | ericduran |
#5 | show_nested_fieldset_legends-1212314-5.patch | 720 bytes | rickvug |
#2 | show_nested_fieldset_legends-1212314-2.patch | 503 bytes | dtarc |
Comments
Comment #1
dtarc CreditAttribution: dtarc commentedPatch attached
Comment #2
dtarc CreditAttribution: dtarc commentedTrying another patch to work with drush make.
Comment #3
dtarc CreditAttribution: dtarc commentedThis may be a duplicate of a core issue: #1015798: Fieldsets inside vertical tabs have no title and can't be collapsed.
However, since Tao is explicitly setting those legends to "display:none" it will need to be fixed here even when it gets fixed in core:
.vertical-tabs .vertical-tabs-panes .vertical-tabs-pane legend { display:none; }
Also I notice that there is a similar issue in the Rubik queue: #1172040: Contrib solution for non-collapsible fieldsets and missing titles. With Tao being Rubik's base theme the fix should come here.
Comment #4
jonathan1055 CreditAttribution: jonathan1055 commentedHi,
Issue #1172040: Contrib solution for non-collapsible fieldsets and missing titles is not in the Rubik issue queue, it is in Scheduler, where we use collapsible fieldsets which may be inside vertical tabs. I devised a way to fix the core problem within scheduler to allow our users to continue to use the D7 version. Originally it just fixed core themes, but now I have expanded the fix so that any specific theme which reports the problem can be corrected by scheduler until such time as the base theme is corrected.
In my patch there was also a specific correction for Rubik/Tao which was not a problem on Safari or Chrome but Firefox needed the fix. You are welcome to use it:
The critical part is that it is the second div to have class=fieldset-content. I think this may be a fault in the html generation in core to have two levels of nested divs which both have the same class. I do not thinnk this is actually what was intended.
Jonathan
Comment #5
rickvug CreditAttribution: rickvug commentedAttached is an updated version of the patch in comment #1. I added a 1px padding-top to the fieldset, which fixes a bug that causes Chrome not to respect the 30px margin. I also incorporated the fieldset border from comment #4 but changed the color to #ddd to match the fieldset legend.
Comment #6
ericduran CreditAttribution: ericduran commentedActually the patch should be a lot simpler.
Here's my fix. It just add the ">" being that we want the direct child not every legend to be hidden.
Patch attached also here are some screenshots of before and after:
Before:
After:
Comment #7
ericduran CreditAttribution: ericduran commentedAlso switching to dev since is still a problem there.
Comment #8
evanbarter CreditAttribution: evanbarter commented#6 works for me with scheduler, as advertised and I was also able to test it with Metatags. Let's get this in there, this has been an annoying problem for too long.
Comment #9
jonathan1055 CreditAttribution: jonathan1055 commentedFor info, the core issue #1015798: Fieldsets inside vertical tabs have no title and can't be collapsed was committed to dev at the end of February, so it should appear in the next full release of D7.
Comment #10
haydeniv CreditAttribution: haydeniv commentedIs this still an issue now that the core fix has been committed?
Comment #11
Dave ReidIt does in fact look like this is resolved with the core update.
Comment #12
haydeniv CreditAttribution: haydeniv commentedFair enough.
Duplicate of #1015798: Fieldsets inside vertical tabs have no title and can't be collapsed