Is there a way to call the active tab on a link to a page. We have a CCK type with 4 tabs and sometimes we want to have the page linked to the content in a specific tab. For example the link would look like this: http://www.example.com/product?tab=pricing and when you follow this link you wind up at the product page with the pricing tab open vs the default tab.

Josh

Comments

nedjo’s picture

Project: CCK Fieldgroup Tabs » Tabs (jQuery UI tabs)

I think support for url linking was part of a previous version of the jquery tabs library but hasn't been revived. I did recently add a relevant method to tabs module (for preselecting the active tab), but I'm not sure we can easily use it here. In any case, any fix shd go into tabs module.

mysurfari.adam’s picture

jdblank,
Using version 1.0 of Tabs(jQuery UI) and CCK Field Group Tabs, I am able to link to an edit page and open a specific tab using the following format: "www.example.com/node/$nid/edit#tabs-fieldgroup_tabs-N". Where N = the tab number i want opened. Maybe something like this will work for you.... Possibly "http://www.example.com/product#tabs-fieldgroup_tabs-3".

nedjo’s picture

Status: Active » Fixed

Thanks for the note.

jdblank’s picture

This works for me although the syntax was #tabs-tabset-4

However, it does not work for reloads if you switch tabs once you are on the page. When you reload you go to the default tab or if you had an anchor tag you go to that tab.

apmac’s picture

"I think support for url linking was part of a previous version of the jquery tabs library but hasn't been revived." Is there any intention to revive support for this? Being able to link to a chosen tab would be very useful.

I have tried to revert to Tabs(jQuery UI) version 1.0 to achieve what mysarfari.adam and jdblank achieved but this broke my content type with:
Call to undefined function tabs_pre_render_tabset() in absolutepath\cck_fieldgroup_tabs\cck_fieldgroup_tabs.module on line 135

Any suggestions on how to resolve this issue and make linking to a specified tab work would be greatly appreciated.

GrimSage’s picture

subscribe

nedjo’s picture

I was referring to a previous version of the jQuery library, not of the Drupal tabs module.

Have you tried adding the jquery cookie library that ships with jquery UI?

apmac’s picture

Hi

Thanks for the tip. Enabling jQuery UI module with jQuery UI 1.6 has enabled me to link one tab to another tab using the link format as detailed by jdblank @ #4 but I do have to set the link to open in a new tab. If the link is set to open in the current tab the active tab is reloaded again rather than the tab specified in the link.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

adpo’s picture

I`m using jQuery UI module with jQuery UI 1.6 and the answers @ #4 and #8 are not working for me. ie:
www.example.com/node/[nid]/edit#tabs-tabset-2 is not working for me and.
www.example.com/node/[nid]/edit#group_samplegroup2 either.
That you for reply.

AvalancheOfLlamas’s picture

Status: Closed (fixed) » Active

Agreed with 10. I was linked here from #471152: Linking between tabs in panel node. The maintainer pointed us to here (http://jqueryui.com/demos/tabs/#...select_a_tab_from_a_text_link_instead...). Could this possible be of use/incorporated into the module?