Choosing the "hide empty tabs" option results in possibilities of direct links being broken when tabs are hidden.
This is because if a tab is hidden, the index number of every tab that is rendered after it is reduced by one. Currently, direct links to tabs (linking to the page, and having that tab be in the active state) are based on the tab's index value. You see what I'm getting at...
To fix this, I'm attaching a patch that preserves the index value, but passes "NULL" as the tab's content. The tab is not rendered, but the index value is skipped, so it won't break all the other links that come after it in the index.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | quicktabs.1003748.patch | 2.25 KB | jessehs |
Comments
Comment #1
jessehsHere's the patch -- applied against 3.x-dev branch.
Comment #2
katbailey commentedHmm, this is indeed a problem and one I never thought of before - sorry for not noticing your patch until now. It looks fine but I'm a little nervous about how it might interfere with the JavaScript's use of tab indices. Perhaps this won't have any repercussions at all but I'll need to test it to make sure.
Comment #3
katbailey commentedOK, it did need a little bit extra to make sure the js worked properly, but committed - thanks!
http://drupalcode.org/project/quicktabs.git/commitdiff/9e8deace91720ca3d...
Comment #4
katbailey commentedAlso committed a version of the patch to 7.x-3.x