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.
Hello,
I noticed user generated Views tables do not have the .table class added required by Bootstrap.
Comment | File | Size | Author |
---|---|---|---|
#1 | bootstrap-add-table-class-to-views-table-2104671-1.patch | 386 bytes | valkum |
Comments
Comment #1
valkum CreditAttribution: valkum commentedHere is a patch for that.
Works for me.
Comment #2
valkum CreditAttribution: valkum commentedComment #3
shelaneIs that in the views_bootstrap module? I use the module for adding carousels, but haven't tried it to see if it adds this class in the table output.
Comment #4
markhalliwellNo, this is just for a standard Views table style.
Thanks @valkum!
Committed de74cfe to 7.x-3.x.
Comment #5
jeremymcminn CreditAttribution: jeremymcminn commentedI'm not sure what I'm doing, but this does not add a table class to my views automatically? Ideas? I have the latest dev release installed.
Comment #6
markhalliwellHmm, try renaming the file to views-view-table.vars.php. I can't believe I didn't catch this.
Comment #7
jeremymcminn CreditAttribution: jeremymcminn commentedYep that did the trick. Thanks Mark.
Comment #8
markhalliwellOpened #2108451: Rename views.vars.php to views-view-table.vars.php to deal with this regression.
Comment #9
valkum CreditAttribution: valkum commentedComment #10.0
(not verified) CreditAttribution: commentedoijiojiojioj
Comment #11
markobahor CreditAttribution: markobahor commentedThis doesn't work if you use views_aggregator tables. The ".table" class is still missing then.
Comment #12
markhalliwellThat is because it is an entirely separate module/views plugin/theme hook.
Please try the latest 7.x-3.1-beta2 or dev version.
That module appears to use
theme('table', ...)
which means that the latest code should add this class in automatically now. See the related issues, specifically: http://cgit.drupalcode.org/bootstrap/tree/theme/system/table.vars.php?id...Comment #13
markobahor CreditAttribution: markobahor commentedI am using the latest dev version 7.x-3.1-beta2+16-dev. The problem is still there with views_aggregator tables.
Sorry about the lack of info.
Comment #14
markhalliwellPlease do not open old issues.
https://www.drupal.org/node/add/project-issue/bootstrap#creating_new_issues
What you are requesting is to support an entirely separate [low install] module. This is a feature request, not a bug. It has nothing to do with this issue (which is about supporting core's theme_table). I would recommend looking at existing implementation and duplicate the functionality for their specific template/theme hook in your sub-theme. I do not see this being widely supported by this project (at the moment).