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.
I created a fieldgroup with Horizontal Tabs, and it works awesome. But I'm wondering if there's a way to insert a unique CSS Class or ID to each "tab button". I'm attaching a screenshot of the code that is being rendered. YOu can see that each of the "horizontal-tab-list" items has the same CSS Class, except for the 1st and last items have that added class. But I'd like a unique CSS class or ID for each item, if possible?
Comment | File | Size | Author |
---|---|---|---|
#8 | tab_buttons.png | 22.74 KB | bechtold |
Screen shot 2011-09-28 at 10.46.57 AM.png | 62.26 KB | minneapolisdan |
Comments
Comment #1
bryancasler CreditAttribution: bryancasler commentedsubscribe
Comment #2
Stalski CreditAttribution: Stalski commentedCertainly possible. this will be included in next iteration.
Comment #3
minneapolisdan CreditAttribution: minneapolisdan commentedThanks for the quick reply, I appreciate it.
Comment #4
Stalski CreditAttribution: Stalski commentedFixed and pushed.
Comment #6
lhugg CreditAttribution: lhugg commentedThis fix does not seem to work in versions 7.x-1.1 thru 1.x-1.3. The fields are there to be added, but do not render in the code.
Comment #7
mel-miller CreditAttribution: mel-miller commentedAlso does not work on latest Dev snapshot (7.x-1.3+5-dev).
ID works, but not class.
Comment #8
bechtold CreditAttribution: bechtold commentedI think this works as needed. There are unique classes. (i'm not sure what the status should be set to)
See my screenshot in the red box.
If you want the group names like in the green box look here: https://drupal.org/node/2172645
Comment #9
nils.destoop CreditAttribution: nils.destoop commentedThis works ok. The classes / ids are set on the fieldsets, never on the li's.
Comment #10
fietserwinThe classes are unique but not predictable, as "#access" restrictions might change the index of a given group/button in the tab list. Therefore, @bechtold's idea in #2172645: group_name as class in tab buttons (add semantic classes based on group name) is better. Please go over there and review if you agree.
Comment #11
gettysburger CreditAttribution: gettysburger commentedHas this been resolved? I am using 7.x-1.5 and am not able to add an ID to a Horizontal Tab, just a Horizontal Tab Group. Thanks.