Currently a horizontal tabs group element is preceded by a non-informative

' . t('Horizontal Tabs') . '

'. I think it would be better (for screen reader users) to use the field group label in this header.

The use of the "extra CSS classes" field should allow themers to make it visible in "normal" browsers as well.

CommentFileSizeAuthor
#2 1155246.patch920 bytesfietserwin

Comments

Stalski’s picture

Status: Active » Postponed (maintainer needs more info)

Can you explain what you mean. Horizontal tabs is ported from vertical tabs. I don't see any difference there.
Does the problem occur on verticals too?

fietserwin’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new920 bytes

I'm sorry for the confusion.

In the UI ("manage fields" or "manage display" tab of content types) you can define a label for a "horizontal tabs group". This is label is not used during displaying either the create/edit form for a new node or when a node is being shown. At the same time a non-descriptive h2 header is added in front of a group of horizontal tabs stating that "horizontal tabs are following" (line 902, function theme_horizontal_tabs, file field_group.module).

My idea is to use the label in the h2 header instead of the text t('Horizontal Tabs'). Looking with a debugger, I noticed that the label is not available in the theme function so the field_group_field_group_pre_render function should add it. The proposed patch probably better explains the idea.

Notes:
- You could do the same for vertical tabs, but as the theme function is in core that would also need a change over there.
- If you don't want to differentiate between vertical and horizontal tabs, you should at least add the #title elements in the prerender function, so people can overrule the theme function and have that info available in their theme function.
- If you do accept all of this patch, I will propose a similar change for D8 core for the vertical tabs theme function.
- I used check_plain, not filter_xss_admin. Form element labels on node edit are processed using filter_xss_admin, but field labels on node show are processed using check_plain. I guess that check_plain for both cases suffices here.

Stalski’s picture

Status: Needs review » Fixed

Pushed to git
thx for the patch.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

fraweg’s picture

Hello,

can everyone do a patch for vertical tabs too? I am not fit in this, but I need a header above the tab-group.
Thanks in advanced!
Frank

hanoii’s picture

@fraweg or anybody else needing vertical tabs titles feel free to try patches at #1577900: Use field group label in h2 above vertical tabs group