Quicktabs

SERVER-SIDE version of "remembering" user's last Drupal quicktab

Have Drupal remember a user's last QuickTab - on the SERVER side!

In this blog post I gave an example of client-side script to remember the last Drupal QuickTab a user loaded so that when he came back to that page it was already selected again, instead of the default tab. It's a fine solution, but in some cases it's a drag to have that first tab grind the server when you are immediately going to flick over to a different tab anyway.

So here's a server-side version that stores the last tab in the $_SESSION variable - it will recall the last tab that *executed* (which is not necessarily the last on the user viewed) but in most cases that's perfectly acceptable. Put this in your Global PHP header in the view:

Tags: 

How to Make Drupal Quicktabs "Remember" the Last Tab on Page Refresh

With a little JavaScript you can make your QuickTabs Fergalicious!

It's annoying to have Drupal QuickTabs revert to the default tab on every page load. There are a number of hacks out there that require changes to default ("core") files to make the last tab get re-selected on page refresh. However, the following fix will make the last tab re-select on page load. In my particular case I had 26 tabs, labelled A through Z, which each contained the same view, but with different parameters.

At the top of the view I included a Global PHP header with the following code:

jQuery(document).ready(function() {
thing = jQuery('#quicktabs-techspec').find('.active').find('.active').attr('id');
jQuery.cookie("techspec-tab", thing);
});

..which records the active tab (from my QuickTabs named "techspec") in a cookie. Then in the Panels page, where the QuickTabs were located, I included a panel with the following code:

Tags: 

Subscribe to RSS - Quicktabs