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.
When a site has several tabs with lots of content, loading tab content as they are needed (with AJAX and jQuery) saves bandwidth. An example might be if you are including photo galleries under the tab, with 7 tabs each totalling around 1 MB that could mean 6 MB of wasted bandwidth on each page load.
Comments
Comment #1
blackandcode CreditAttribution: blackandcode commentedThis option would be great to implement!!!!
Comment #2
milittlan CreditAttribution: milittlan commentedBe carefull!!!
Comment #3
eXoSaX CreditAttribution: eXoSaX commentedI agree!
Subscribed.
Comment #4
TelFiRE CreditAttribution: TelFiRE commentedFollowing. Would love to see.
Comment #5
Opensoft CreditAttribution: Opensoft commented+1
Comment #6
rogical CreditAttribution: rogical commentedImage gallery/slideshow as a second tab is very common, this would be very useful!
Comment #7
Hydra CreditAttribution: Hydra commentedI like this idea. But this is not what field group ment to do. Field group is in the end a simple theme wrapper. So it does not controle the node load or anything like that. Did you check out the quicktabs module? If this will ever be somehow realized, it won't be in fieldgroup's core.
Comment #8
Marvine CreditAttribution: Marvine commentedHi,
Any news about this improvement (other contrib module) ?
I am really interested by this feature because it can solve some performances issues when we have a lot of groups and fields.
Comment #9
yannickooI also would recommend the Quick Tabs module. You could create a view which display your content.
Comment #10
jason.fisher CreditAttribution: jason.fisher commentedI would like to see 'lazy-loading' of field group tabs to allow the initial DOM to be completed more quickly.
Comment #11
sstedman CreditAttribution: sstedman commented+1 Same use case - multiple image galleries as tabs.
Subscribe.
Comment #12
Andru CreditAttribution: Andru as a volunteer commentedI'd like to see this too, and I found a couple of modules that come close, a tweak might do it.
The Lazyloader module with Field Groups module does only load the image when the tab is opened, including when nodes are displayed as content in Views.
jQuery AJAX Load will ajax load content but requires creating a link as the content under a tab, so on opening the tabbed area you have to then click that link to see the map or other ajax content. What is needed is to make clicking on the Field Group tab that opens this tab also carry out that action.
Quicktabs creates blocks and so will not do what I want, which is to show rows of tabbed content in views, where the clicked tabs in each row either lazyload or ajax load the maps and images that are initially hidden under those tabs.
Comment #13
Andru CreditAttribution: Andru as a volunteer commentedAs said you just need a tweak to make this work with the jQuery AJAX load module, and here is one that worked for me. Having used that module to create a link that will load content via Ajax, you just need a tiny addition to a single js file of the FieldGroups module so that clicking to open a tab also clicks that link. Go to horizontal-tabs.js and add these two lines to the this.link.click(function () function:
Also to get the image lazyloader module to work properly there you need to add this in that same function:
$("html,body").trigger("scroll");
otherwise the images just load the spinning placeholder gif forever until you actually scroll.