Hi,

is there a way to set a custom url for a quicktab-"deeplink" ?
Right now a tab has a url like
http://example.com/somepage?quicktabs_2=3#quicktabs-2

what about using the title of the tab in the link like
http://example.com/somepage?tab2#title-of-node

Comments

WoozyDuck’s picture

Same request here

fourmi4x’s picture

Would love to see that too...
A good start could be : where are the URLs constructed (which file/line) ?

fourmi4x’s picture

I worked out a temporary workaround by modifying some lines in the quicktabs.module file.

---------------
The first bit replaces the second "quicktabs" word by the name of the tab (converted into an url format) :
Replace the 2 following lines by these :

  • Line 198: 'id' => strtolower(str_replace(array(' ', ' '), '-', preg_replace('/[^a-zA-Z0-9 s]/', '', trim($tab['title'])))) . '-' . $quicktabs['qtid'],
  • Line 377: 'fragment' => strtolower(str_replace(array(' ', ' '), '-', preg_replace('/[^a-zA-Z0-9 s]/', '', trim($tab['title'])))) . '-' . $qtid,

---------------
The second bit replaces the first "quicktabs" word with the node title :
Replace the 4 following lines by these :

  • Line 359: unset($query[$tabname . $qtid]);
  • Line 362: $query[$tabname . $qtid] = $tabkey;
  • Line 583: $active_tab = isset($_GET[$tabname . $quicktabs['qtid']]) ? $_GET[$tabname . $quicktabs['qtid']] : $active_tab;
  • Line 584: $active_tab = isset($_GET[$tabname . $quicktabs['qtid']]) ? $_GET[$tabname . $quicktabs['qtid']] : $active_tab;

After that, add these 3 lines after line 357 to get the node title into the tab url :

Line 357 is // Need to construct the correct query for the tab links.
and then add :

  $node = node_load(arg(1));
  $nodetitle = strtolower(str_replace(array('  ', ' '), '-', preg_replace('/[^a-zA-Z0-9 s]/', '', trim($node->title))));
  $tabname = $nodetitle . '-';

and then it continues with
$query = $_GET; which should be now line 361 !

---------------
Hope that helps. Beware it is not fully tested, but it works for me ! (version 6.x-2.0-rc)
Sorry I don't know how to make a patch, but this shouldn't really go in a patch anyway, it is just a temporary fix...

What would be awesome would be tu be able to use tokens directly into these URLs !!

cbrody’s picture

Subscribing

urbanbricks’s picture

Subscribing

ParisLiakos’s picture

Subscribe and agree..

?quicktabs_1=1#quicktabs-1 is VERY ugly

ParisLiakos’s picture

Title: Use custom url for quicktab path » Custom URL for quicktab path
Category: support » feature
doublejosh’s picture

Edit: Path alias

doublejosh’s picture

Just did redirects so that we can give out nice URLs to people, but sure would rock to have them as a config feature.
Perhaps there a path to the Path module that allows fragments?

Rameez’s picture

Subscribing
really imp issue. However i'm interested to know if we can completely remove links on tab? wat if they behave like buttons?

aalireza’s picture

Subscribing

goldlilys’s picture

Version: 6.x-2.0-rc5 » 7.x-3.4

This feature would also be useful for D7 version since the current url is UGLY. If not a custom url path, can it be the title of the tab itself instead of #quicktabs-page=1 ... have #quicktabs-page=tab-title OR #page=tab-title OR just #tab-title

Ndesign’s picture

Subscribing

Exploratus’s picture

Subscribe.

smustgrave’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

With D7 EOL approaching in a month I'm starting to triage the D7 side of quicktabs queue. This doesn't appear to have any code so believe this may not make it, sorry! Thanks though!

If still an issue or needed for 4.0.x (latest branch) feel free to reopen