Closed (duplicate)
Project:
Quick Tabs
Version:
5.x-1.3
Component:
User interface
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
3 Jun 2008 at 21:00 UTC
Updated:
29 Oct 2009 at 00:29 UTC
Jump to comment: Most recent
Comments
Comment #1
Anonymous (not verified) commentedI have a similar situation. I want to link from another section on my site to a specific QT.
Any help would be greatly appreciated.
Comment #2
kmasters commentedHas anybody found a solution to this?
Thanks!
Kevin.
Comment #3
aaustin commentedI just posted a possible fix for the Drupal 6 version.
I am not using this with Drupal 5 but would imagine the fix might be transferable.
http://drupal.org/node/308633
Comment #4
katbailey commentedPlease see http://drupal.org/node/308633#comment-1019965
Comment #5
pasqualle#308633: direct url to a tab
Comment #6
rigoy22k commentedI can't use aaustin's solution on d5. But i made few modifications only on quicktabs.js to make Direct Link to a Quick Tab,
So this is quicktabs.js on ../js/ in quicktabs module
Drupal.quicktabs = function() {
var indexPagina = gup('qt_active');
$('div.quicktabs').hide();
$('div.quicktabs:eq('+indexPagina+')').show();
$('ul.quicktabs_tabs li:eq('+indexPagina+')').addClass('active');
var effect = Drupal.settings.quicktabs.effect;
var clickFunction = function() {
var tabIndex = this.myTabIndex;
$(this).parents('div.quicktabs_wrapper').find('div.quicktabs').hide();
$(this).parents('li').siblings().removeClass('active');
$(this).parents('li').addClass('active');
switch (effect) {
case 'none':
$(this).parents('div.quicktabs_wrapper').find('div.quicktabs:eq('+tabIndex+')').show();
break;
case 'fade':
$(this).parents('div.quicktabs_wrapper').find('div.quicktabs:eq('+tabIndex+')').fadeIn();
break;
case 'slide':
$(this).parents('div.quicktabs_wrapper').find('div.quicktabs:eq('+tabIndex+')').slideDown('slow');
break;
}
return false;
};
$('ul.quicktabs_tabs').each(function(){
var i = 0;
$(this).find('li a').each(function() {
this.myTabIndex = i++;
});
});
$('ul.quicktabs_tabs li a').bind('click', clickFunction);
}
if (Drupal.jsEnabled) {
$(document).ready(Drupal.quicktabs);
}
function gup( name )
{
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null )
return "";
else
return results[1];
}
// $Id: quicktabs.module,v 1.6.2.17
(the solution its functional but i'm not js programmer, if anyone can check this, will be very appreciate for me :D )
using this:
http://www.Yourdrupalsite/Yournode?qt_active=Number of the tab.
Comment #7
druryjeff commentedthanks for the mod, rigoy22k. this worked as advertised. however, i had to add a few mods to get it to work for my specific situation:
if you try to access the page containing the tabs without passing the "qt_active" string (using your example url above, http://www.Yourdrupalsite/Yournode), none of the tabs get populated.
the original quicktabs.js has a line to populate the initial tab -
$('div.quicktabs:first-child').show();- but this line is omitted in your code in favor of a function call that passes the query string to pick the desired tab ($('div.quicktabs:eq('+indexPagina+')').show();).to remedy this, i simply added a conditional statement that checks if the value of indexPagina is empty (indicating the default, no query string added, status); if this is true, i execute the original code -
$('div.quicktabs:first-child').show();- otherwise, i execute your code -$('div.quicktabs:eq('+indexPagina+')').show();:i hope this helps someone.
Comment #8
rigoy22k commentedYou right! Thanks you a lot!.
Work Perfectly.
Comment #9
tchopshop commentedUnfortunately, this isn't working for me... can you specify where to put the code from #6 and also where to put the addition to the code in #7?
I want to link directly to a tab from a menu item, so I'm putting in full URLs in the menu block...